I'm getting a small apache problem. It's most likely something so minor that i'm approximately searching it. This is actually the scenario. I've an Ubuntu 10.04 server setup with 2 websites. Before all this, I'd one site and that i utilized it through the Ip. I simply added another site, that one having a domain title, and that i produced a brand new file within the sites-available dir. having a connect to the websites-enabled dir.
The very first site (the main one I utilized via IP) config looks something similar to this:
#Default <VirtualHost *:80> DocumentRoot /var/www ......etc
Then your other config is one thing such as this:
#Secondary <VirtualHost TheDomainName.com:80> DocumentRoot /var/www/thedomainname .......etc
If everyone need me to publish the entire config files I'll. How come the request the Ip fall right through to the DomainName config? Could it be since they're identical IP addresses? How do you differentiate between your two?
Basically attempt to set the ip around the first "Default" config rather than "*", this website only works and that i can't ever arrive at the other "Secondary" site.
Are you currently using ServerName and ServerAlias inside your virtual host directive?
<VirtualHost *:80> ServerName www.domain.com ServerAlias domain.com domain.net www.domain.net
Another factor, and you're simply most likely carrying this out, but restarting apache after making changes
(or something like that similar .. /etc/init.d/apache2 restart or lighttpd if you're by using their)
Different sites cannot share IP and port combination unless of course you utilize name based virtual hosts. The example in the manual is:
NameVirtualHost *:80 <VirtualHost *:80> ServerName www.domain.tld ServerAlias domain.tld *.domain.tld DocumentRoot /www/domain </VirtualHost> <VirtualHost *:80> ServerName www.otherdomain.tld DocumentRoot /www/otherdomain </VirtualHost>
If you use this feature, unknown domains map towards the first
<VirtualHost> present in your configuration.
<VirtualHost *:80> ServerName oink.domain.com DocumentRoot /var/www ...
<VirtualHost *:80> ServerName blah.domain.com DocumentRoot /var/www/thedomainname ...