dudup
asked on
Apache virtual host problem
first.com and forst.com have the same IP address and the server is using one apache 2.0.50.
If I uncomment the first.com virtual host, I cant access www.forst.com. If I access www.forst.com, I will get www.first.com.
If I put comment in first.com virtual host (like below), I can access www.forst.com correctly (but not www.first.com because disabled).
Anyone know how to fix this? So I can access both virtual host correctly ?
Thanks.
NameVirtualHost *:80
#<VirtualHost *:80>
# ServerAdmin webmaster@first.com
# DocumentRoot /home/www/first.com/html/
# ScriptAlias /cgi-bin/ /home/www/first.com/cgi-bi n/
# ServerName main.first.com
# ErrorLog /home/www/first.com/logs/f irst.com-e rror_log
# CustomLog /home/www/first.com/logs/f irst.com-a ccess_log "%h %l %t %>s %b %{Referer}i -> %U %q"
#</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@forst.com
DocumentRoot /home/www/forst.com/html/
ScriptAlias /cgi-bin/ /home/www/forst.com/cgi-bi n/
ServerName main.forst.com
ErrorLog /home/www/forst.com/logs/f orst.com-e rror_log
CustomLog /home/www/forst.com/logs/f orst.com-a ccess_log "%h %l %t %>s %b %{Referer}i -> %U %q"
</VirtualHost>
If I uncomment the first.com virtual host, I cant access www.forst.com. If I access www.forst.com, I will get www.first.com.
If I put comment in first.com virtual host (like below), I can access www.forst.com correctly (but not www.first.com because disabled).
Anyone know how to fix this? So I can access both virtual host correctly ?
Thanks.
NameVirtualHost *:80
#<VirtualHost *:80>
# ServerAdmin webmaster@first.com
# DocumentRoot /home/www/first.com/html/
# ScriptAlias /cgi-bin/ /home/www/first.com/cgi-bi
# ServerName main.first.com
# ErrorLog /home/www/first.com/logs/f
# CustomLog /home/www/first.com/logs/f
#</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@forst.com
DocumentRoot /home/www/forst.com/html/
ScriptAlias /cgi-bin/ /home/www/forst.com/cgi-bi
ServerName main.forst.com
ErrorLog /home/www/forst.com/logs/f
CustomLog /home/www/forst.com/logs/f
</VirtualHost>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.