Solved

Apache virtual host problem

Posted on 2004-10-08
1
165 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

631 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