How can I setup multiple sites
Hello,
I have successfully setup LAMP using Kubuntu 10.04, MYSQL, Apache2, and PHP on my laptop.
I have successfully setup site3(dot)com on my computer.
However, I cannot setup site2 or site1. They all point to the same site.
Pinging all three sites gives the same response: 127.0.0.1
Here is a snippet from the /etc/hosts file:
Code:
127.0.0.1 localhost site3(dot)com site2(dot)com site1(dot)com
127.0.1.1 ryy
Here is the error message I get when I reload Apache:
Code:
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Tue Aug 17 17:51:50 2010] [warn] VirtualHost site1(dot)com:0 overlaps with VirtualHost site2(dot)com:0, the first has precedence, perhaps you need a NameVirtualHost directive
[Tue Aug 17 17:51:50 2010] [warn] VirtualHost site3(dot)com:0 overlaps with VirtualHost site1(dot)com:0, the first has precedence, perhaps you need a NameVirtualHost directive
Here is config file for a single site:
Code:
<VirtualHost site1(dot)com>
ServerAdmin webmaster(at)localhost
#We want to be able to access the web site using www(dot)dev(dot)example(dot)com or dev(dot)example(dot)com
ServerAlias site1(dot)com
DocumentRoot /home/ryy/Sites/public_html/site1(dot)com
#if using awstats
ScriptAlias /awstats/ /usr/lib/cgi-bin/
#we want specific log file for this server
CustomLog /var/log/apache2/example(dot)com-access.log combined
</VirtualHost>
Has anyone run into this problem before?
Is NameVirtualHost directive the way to go? What changes do I need to make to implement it?
Many thanks in advance for your help.