Solved

Apache virtual host problem

Posted on 2004-10-08
1
164 Views
Last Modified: 2010-03-04
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>

0
Comment
Question by:dudup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 19

Accepted Solution

by:
ramazanyich earned 100 total points
ID: 12266619
You ServerName directives are worng.
It should be
ServerName www.first.com
for www.first.com 
and
ServerName www.forst.com

for www.forst.com


Check http://httpd.apache.org/docs-2.0/vhosts/name-based.html for details.
0

Featured Post

Don't Miss ATEN at InfoComm 2017!

Visit booth #2167 to see the  new ATEN VM3200 32 x 32 Modular Matrix Switch. Other highlights include the VE8950 4K HDMI Over IP Extender, VS1912 12-Port DP Video Wall Media Player  and VK2100 ATEN Control System. Register now with Free Pass Code ATEN288!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question