ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Two Apache Virtual Hosts, One Server, Port 80

    IT Discussion
    4
    17
    2.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      thanksajdotcom @A Former User
      last edited by

      @thecreativeone91 said:

      Ah, vhosts. It's pretty simple. It see what domain was requested and use the correct directory. You will have to use the dns name to browse the site though, IP address won't return the correct website with vhosts of course since their is only one.

      DNS name is fine. That's how it'll be used exclusively.

      I've followed this, updated for Ubuntu 14.04 (always a couple tweaks).
      https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-12-04-lts

      Can you see anything I'm missing to get DNS working?

      ? 1 Reply Last reply Reply Quote 0
      • ?
        A Former User @thanksajdotcom
        last edited by

        @ajstringham What is it currently doing/what's your error?

        T 1 Reply Last reply Reply Quote 0
        • T
          thanksajdotcom @A Former User
          last edited by

          @thecreativeone91 said:

          @ajstringham What is it currently doing/what's your error?

          The site currently loads my site correctly but not the other website. Everything appears to be setup correctly. I can't figure out what the issue is.

          J 1 Reply Last reply Reply Quote 0
          • J
            JaredBusch @thanksajdotcom
            last edited by

            @ajstringham said:

            @thecreativeone91 said:

            @ajstringham What is it currently doing/what's your error?

            The site currently loads my site correctly but not the other website. Everything appears to be setup correctly. I can't figure out what the issue is.

            Assuming this is still hosted internally, is your hairpin NAT rules picking up the second DNS name and rerouting appropriately? I cannot think of a scenario that wouldn't since it should all revolve around the IP, but just another thing to check.

            T 1 Reply Last reply Reply Quote 0
            • J
              JaredBusch
              last edited by

              my httpd.conf (CentOS 6.5) looks like this:

              <VirtualHost *:80>
              	ServerAdmin sorvani@gmail.com
              	DirectoryIndex index.html
              	DocumentRoot /var/www/daerma.com
              	ServerName daerma.com
              	ServerAlias *.daerma.com
              	LogLevel warn
              	ErrorLog logs/daerma.com-error_log
              	CustomLog logs/daerma.com-access_log common
              </VirtualHost>
              <VirtualHost *:80>
                 ServerAdmin sorvani@gmail.com
                 DirectoryIndex index.php index.html index.htm
                 DocumentRoot /var/www/jaredbusch.com
                 ServerName jaredbusch.com
                 ServerAlias *.jaredbusch.com
                 LogLevel Warn
                 ErrorLog logs/jaredbusch.com-error_log
                 CustomLog logs/jaredbusch.com-access_log common
              </VirtualHost>
              
              1 Reply Last reply Reply Quote 0
              • J
                JaredBusch
                last edited by

                and no, there is nothing on jaredbusch.com yet. I just bought it because it was available.

                T 1 Reply Last reply Reply Quote 1
                • T
                  thanksajdotcom @JaredBusch
                  last edited by

                  @JaredBusch said:

                  and no, there is nothing on jaredbusch.com yet. I just bought it because it was available.

                  It should have been "youcametojared.com". 😛

                  T 1 Reply Last reply Reply Quote 0
                  • T
                    thanksajdotcom @thanksajdotcom
                    last edited by

                    @ajstringham said:

                    @JaredBusch said:

                    and no, there is nothing on jaredbusch.com yet. I just bought it because it was available.

                    It should have been "youcametojared.com". 😛

                    Then again, this could send entirely the wrong message...

                    1 Reply Last reply Reply Quote 0
                    • T
                      thanksajdotcom @JaredBusch
                      last edited by

                      @JaredBusch said:

                      @ajstringham said:

                      @thecreativeone91 said:

                      @ajstringham What is it currently doing/what's your error?

                      The site currently loads my site correctly but not the other website. Everything appears to be setup correctly. I can't figure out what the issue is.

                      Assuming this is still hosted internally, is your hairpin NAT rules picking up the second DNS name and rerouting appropriately? I cannot think of a scenario that wouldn't since it should all revolve around the IP, but just another thing to check.

                      Hairpin NAT rules?

                      1 Reply Last reply Reply Quote 0
                      • J
                        JaredBusch
                        last edited by

                        @ajstringham said:

                        @JaredBusch said:

                        @ajstringham said:

                        @thecreativeone91 said:

                        @ajstringham What is it currently doing/what's your error?

                        The site currently loads my site correctly but not the other website. Everything appears to be setup correctly. I can't figure out what the issue is.

                        Assuming this is still hosted internally, is your hairpin NAT rules picking up the second DNS name and rerouting appropriately? I cannot think of a scenario that wouldn't since it should all revolve around the IP, but just another thing to check.

                        Hairpin NAT rules?

                        When you host stuff at home, you will have a problem with NAT.

                        daerma.com resolves publicly my current IP.
                        but the internal server is on a local IP of course.
                        By default that means daerma.com should not be reachable from inside my network. because a DNS lookup will return the public IP. A router running standard NAT masquerade rules will not route it correctly because it is targeting the WAN port of the router from the LAN.
                        So there were special NAT rules called hairpining designed to handle it.
                        http://en.wikipedia.org/wiki/Hairpinning

                        Almost every home router has it enabled by defualt. I have no idea how dd-wrt handles it, other than to know it has the functionality.

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post