Link to home
Start Free TrialLog in
Avatar of dudup
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-bin/
# ServerName main.first.com
# ErrorLog /home/www/first.com/logs/first.com-error_log
# CustomLog /home/www/first.com/logs/first.com-access_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-bin/
ServerName main.forst.com
ErrorLog /home/www/forst.com/logs/forst.com-error_log
CustomLog /home/www/forst.com/logs/forst.com-access_log "%h %l %t %>s %b %{Referer}i -> %U %q"
</VirtualHost>

ASKER CERTIFIED SOLUTION
Avatar of ramazanyich
ramazanyich
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial