Dagda
02-07-2002, 10:35 AM
I run a web server and one of my virtual hosts is having a problem. when every I try and goto this site it takes me to a different site that I run. Here is part of my config file:
DocumentRoot "/var/www/html"
<VirtualHost IP>
DocumentRoot /home/site1/www/public_html
ServerName site1.com
ScriptAlias /cgi-bin/ /home/site1/www/public_html/cgi-bin/
ErrorLog /home/site1/www/logs/error-log
AgentLog /home/site1/www/logs/browser-log
TransferLog /home/site1/www/logs/access-log
RefererLog /home/site1/www/logs/referer-log
ServerAlias www.site1.com (http://www.site1.com)
</VirtualHost>
<VirtualHost IP>
DocumentRoot /home/site2.com/public_html
ServerName site2.com
ErrorLog /home/site2.com/logs/error-log
AgentLog /home/site2.com/logs/browser-log
TransferLog /home/site2.com/logs/access-log
RefererLog /home/site2.com/logs/referer-log
</VirtualHost>
<VirtualHost IP>
DocumentRoot /home/webmaster/www/site3.com/public_html
ServerName site3.com
ErrorLog /home/webmaster/www/site3.com/logs/error-log
AgentLog /home/webmaster/www/site3.com/logs/browser-log
TransferLog /home/webmaster/www/site3.com/logs/access-log
RefererLog /home/webmaster/www/site3.com/logs/referer-log
ServerAlias www.site3.com (http://www.site3.com)
</VirtualHost>
<VirtualHost IP>
DocumentRoot /home/site4.com/public_html
ServerName site4.com
ServerAlias www.site4.com (http://www.site4.com)
</VirtualHost>
Now when I go to www.site1.com (http://www.site1.com) it takes me to site1.com. When I go to site2.com it takes me to site2.com same with site3 but when I go to www.site4.com (http://www.site4.com) it takes me to site1. I use the same IP for all of these sites.
Please help
DocumentRoot "/var/www/html"
<VirtualHost IP>
DocumentRoot /home/site1/www/public_html
ServerName site1.com
ScriptAlias /cgi-bin/ /home/site1/www/public_html/cgi-bin/
ErrorLog /home/site1/www/logs/error-log
AgentLog /home/site1/www/logs/browser-log
TransferLog /home/site1/www/logs/access-log
RefererLog /home/site1/www/logs/referer-log
ServerAlias www.site1.com (http://www.site1.com)
</VirtualHost>
<VirtualHost IP>
DocumentRoot /home/site2.com/public_html
ServerName site2.com
ErrorLog /home/site2.com/logs/error-log
AgentLog /home/site2.com/logs/browser-log
TransferLog /home/site2.com/logs/access-log
RefererLog /home/site2.com/logs/referer-log
</VirtualHost>
<VirtualHost IP>
DocumentRoot /home/webmaster/www/site3.com/public_html
ServerName site3.com
ErrorLog /home/webmaster/www/site3.com/logs/error-log
AgentLog /home/webmaster/www/site3.com/logs/browser-log
TransferLog /home/webmaster/www/site3.com/logs/access-log
RefererLog /home/webmaster/www/site3.com/logs/referer-log
ServerAlias www.site3.com (http://www.site3.com)
</VirtualHost>
<VirtualHost IP>
DocumentRoot /home/site4.com/public_html
ServerName site4.com
ServerAlias www.site4.com (http://www.site4.com)
</VirtualHost>
Now when I go to www.site1.com (http://www.site1.com) it takes me to site1.com. When I go to site2.com it takes me to site2.com same with site3 but when I go to www.site4.com (http://www.site4.com) it takes me to site1. I use the same IP for all of these sites.
Please help