Solved

Apache virtual host problem

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

705 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now