Correct, the server domain name does resolve to that address. But if I
remove the <Host> entry for the IP and hit the servlet using the IP number I
get a 404 from tomcat.

What's also interesting is I noticed the following piece of logging:


[Fri Aug 17 15:32:29 2001] [warn] VirtualHost 111.22.33.44:80 overlaps with
VirtualHost www.foo.com:80, the first has precedence, perhaps you need a
NameVirtualHost directive






on 8/20/01 12:42 PM, Rob S. at [EMAIL PROTECTED] wrote:

> Interesting... the server domain name should resolve to that IP address,
> right?  You can't just remove the IP-address <Host> entry?
> 
> - r
> 
> On Mon, 20 Aug 2001 12:39:09 -0400 [EMAIL PROTECTED] wrote:
>> I have a servlet based application that needs to be accessed using both the
>> the server IP address and the server domain name.
>> 
>> The problem is that because I have two <host> entries for the same
>> application tomcat "loads" them twice. Not only does this leave me with two
>> instances of the servlets, but the ones I have    marked to load on init have
>> their code called twice which interferes with itself.
>> 
>> I have tried every combination of VirtualHosts I can think of and always
>> run into the issue of in order for Tomcat to recognize that it should
>> handle the request to the servlet I have to add a <Host> entry in
>> server.xml. If I leave out the entry for the IP address Apache passes the
>> request along to tomcat fine, but then Tomcat doesn't recognize it.
>> Likewise for the domain name.
>> 
>> Any thoughts or help? I have included snippets of what I think are the
>> relevant config files and how they should look.
>> 
>> -Steve
>> 
>> ----------------------------------------------
>>> From http.conf:
>> 
>> ...
>> 
>> NameVirtualHost 111.22.33.44
>> 
>> <VirtualHost 111.22.33.44 >
>> ServerName 111.22.33.44
>> ErrorLog /usr/local/apache/logs/error_log
>> DocumentRoot /usr/local/apache/htdocs
>> 
>> JkMount /*.servlet ajp13
>> </VirtualHost>
>> 
>> <VirtualHost 111.22.33.44 >
>> ServerName www.foo.com
>> ErrorLog /usr/local/apache/logs/error_log
>> DocumentRoot /usr/local/apache/htdocs
>> 
>> JkMount /*.servlet ajp13
>> </VirtualHost>
>> ----------------------------------------------
>> 
>> ----------------------------------------------
>>> From server.xml:
>> 
>> ...
>> 
>> <Host name="111.22.33.44" >
>> <Context path="" docBase="/usr/local/apache/servlets" />
>> </Host>
>> 
>> 
>> <Host name="www.foo.com" >
>> <Context path="" docBase="/usr/local/apache/servlets" />
>> </Host>
>> 
>> ...
>> ----------------------------------------------
> 
> 
> 
> 

Reply via email to