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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Virtual host error...

Status
Not open for further replies.

ctroyp1

IS-IT--Management
Feb 7, 2006
13
US
Would anyone have any idea why I would be getting this error when restarting Apache.

###########################################################

server1:# /etc/init.d/apache2 restart
Forcing reload of web server: Apache2[Fri Feb 10 11:28:00 2006][warn]VirtualHost overlaps with VirtualHost the first has precedence, perhaps you need a NameVirtualHost directive
[Fri Feb 10 11:28:02 2006]
[warn] VirtualHost overlaps with VirtualHost the first has precedence, perhaps you need a NameVirtualHost directive
 
Because 'perhaps you need a NameVirtualHost directive'

Steve
 
Ok, please understand that I am not an Apache expert...still learning. I understand how my vhosts are setup within apache2.conf. I did not have this error before adding Tomcat to the system. I have defined these virtual hosts within the server.xml of Tomcat as well.

So how do I add the NameVirtualHost directive under this config?
 
I've never used Tomcat, so you'll need to figure out where the problem actually is. But, essentially the apache error is telling you that you seem to have 2 Virtualhosts set up that seem to be set to answer to the same conditions - they do not have different IP addresses or ports. Therefore, you must intend for them to be diferentiated by name, but apache can't find a NameVirtualHost directive, so it's going to assume the first one is right. faq65-1831 is a general explanation of name-based virtual hosts, but I have no idea how this would incorporate with Tomcat.

Steve
 
ctroyp1,

From the Apache documentation:

The NameVirtualHost directive is a required directive if you want to configure name-based virtual hosts.

In other words, if you want your Apache server to respond to requests for multiple hosts/domains on the same IP address, you need the directive
NameVirtualHost
in your httpd.conf

Wishdiak
A+, Network+, Security+, MCSA: Security 2003
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top