Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache Virtual Host configuration

Status
Not open for further replies.

teamakesmefart

Technical User
Dec 3, 2003
10
GB
Hi All

Hope somebody can help. I have the following at the end of my httpd.conf file:

-----------------------------------------------------

<VirtualHost ServerName DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
</VirtualHost>

<VirtualHost ServerName ProxyPass / ProxyPassReverse / </VirtualHost>

-------------------------------------------------------

When I try to start the Apache server (Apache 2 running on Win32), I get the error message:

-------------------------------------------------------
[warn] VirtualHost overlaps with VirtualHost the first has precedence, perhaps you need a NameVirtualHost directive
-------------------------------------------------------

Needless to say, the warning bears true and my requests to domain2 are not redirected. So ... I tried to rename the VirtualHost directives to NameVirtualHost directives. Then the error message changed to:

-------------------------------------------------------
Invalid command <'NameVirtualHost', perhaps mis-spelled or defined by a module not included in the server configuration.
-------------------------------------------------------

Any pointers would be gladly received.

Many thanks
Pete
Devon, UK
 
As a first shot, try changing ServerName to ServerAlias. Apache behaves a little funny with name based virt hosts and multiple ServerName's, especially if they virt hosts share the same IP.
 
use this
Code:
<VirtualHost 12.34.56.78>
DocumentRoot /var/[URL unfurl="true"]www/html/domain1[/URL]
ServerName [URL unfurl="true"]www.domain1.net[/URL]
</VirtualHost>

<VirtualHost 12.34.56.78>
DocumentRoot /var/[URL unfurl="true"]www/html/domain2[/URL]
ServerName [URL unfurl="true"]www.domain2.net[/URL]
</VirtualHost>

if you still receive errors post them

%, 2004

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top