Two Apache Virtual Hosts, One Server, Port 80
-
@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-ltsCan you see anything I'm missing to get DNS working?
-
@ajstringham What is it currently doing/what's your error?
-
@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.
-
@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.
-
my httpd.conf (CentOS 6.5) looks like this:
<VirtualHost *:80> ServerAdmin [email protected] 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 [email protected] 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>
-
and no, there is nothing on jaredbusch.com yet. I just bought it because it was available.
-
@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".
-
@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...
-
@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?
-
@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/HairpinningAlmost 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.