Is there a turtorial on the useIPVhosts attribute and how it is
"supposed" to work somewhere?  The statement in the <Connector> on-line
documentation is woefully insufficient.

If you want true default host processing based on incoming IP, you can
always set up multiple services:

<Service name="firstdomain">
        <Connector address="1.2.3.4" port="80" .... />
        <Connector address="1.2.3.4" port="443" .... />
        <Engine name="firstdomain" defaultHost="firstdomain.com">
                <Host name="firstdomain.com" .... ">
                        .....
                </Host>
        </Engine>
</Service>
<Service name="seconddomain">
        <Connector address="5.6.7.8" port="80" .... />
        <Connector address="5.6.7.8" port="443" .... />
        <Engine name="seconddomain" defaultHost="seconddomain.com">
                <Host name="firstdomain.com" .... ">
                        .....
                </Host>
        </Engine>
</Service>

Or is this just completely wrong for Tomcat 6.x?  I've not upgraded to
that yet, but noticed the OP's server.xml is missing the Service element
and the Connectors are under the Engine.

Jeff

-----Original Message-----
From: Jeff [mailto:jwi...@cox.net] 
Sent: Tuesday, May 25, 2010 9:04 AM
To: Tomcat Users List
Subject: Re: Tomcat 6.0 always uses default host in multi-host config

No. And again, if I change the default host in the config, the app that 
is displayed is different, so I don't think that's the issue.

On 5/25/2010 8:56 AM, Pid wrote:
> On 25/05/2010 14:13, Jeff wrote:
>    
>> The application does not automatically redirect to 443.
>>
>> Standard HTTP exhibits the same behavior: if the default host is
>> firstdomain.com, http://seconddomain.com still accesses the ROOT app
for
>> firstdomain.com
>>      
> There's no chance you uploaded the apps to the wrong domain is there?
>
>
> p
>
>    
>> On 5/25/2010 7:48 AM, Pid wrote:
>>      
>>> On 25/05/2010 13:00, Jeff wrote:
>>>
>>>        
>>>> I did not have Alias elements inside the Host elements. I did try
both
>>>> w/ and w/o www. so I didn't consider that an issue. After adding
Alias
>>>> elements, the problem persisted.
>>>>
>>>> There are ROOT.xml Contexts in both
>>>> $CATALINA_HOME/conf/Catalina/firstdomain.com and
>>>> $CATALINA_HOME/conf/Catalina/seconddomain.com
>>>>
>>>> Both are simple:
>>>>
>>>> <Context path="" docBase="ROOT" debug="0" />
>>>>
>>>>          
>>> The debug attribute hasn't been used for a while, remove it.
>>> The two other attributes are also useless, remove them.
>>>
>>> If the above is your entire Context definition you can omit the file
>>> entirely.
>>>
>>> Can you disable the HTTPS connectors entirely, temporarily, or does
the
>>> application automatically redirect to a secure channel for all
requests?
>>>
>>>
>>> p
>>>
>>>
>>>
>>>        
>>>> On 5/25/2010 5:06 AM, Pid wrote:
>>>>
>>>>          
>>>>> On 25/05/2010 10:44, Jeff wrote:
>>>>>
>>>>>
>>>>>            
>>>>>> I have two IP-based virtual hosts configured in a standalone
Tomcat
>>>>>> server. Each host has its own SSL certificate and keystore.
Tomcat
>>>>>> appears to behave as if only the default host is defined. When I
hit
>>>>>> seconddomain.com, Tomcat serves the ROOT app for firstdomain.com
and
>>>>>> writes to firstdomain.com access log. When I try
>>>>>> https://seconddomain.com, the domain is untrusted, which I
suspect is
>>>>>> because Tomcat is using the cert for firstdomain.
>>>>>>
>>>>>> If I change the defaultHost value to seconddomain.com, the
behavior
>>>>>> flips and Tomcat serves the ROOT app for seconddomain.com when I
try
>>>>>> http://firstdomain.com.
>>>>>>
>>>>>>
>>>>>>              
>>>>> Are you requesting firstdomain.com or www.firstdomain.com?
>>>>> You have no Alias elements set inside the Host element.
>>>>>
>>>>> Also, are there any Context definitions?  Either in
>>>>> META-INF/context.xml
>>>>> or e.g. tomcat/conf/Catalina/firstdomain.com/
>>>>>
>>>>>
>>>>> p
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>            
>>>>>> AFAIK, the server.xml configuration below should work. Any clues
as to
>>>>>> what is wrong?
>>>>>>
>>>>>> TIA
>>>>>>
>>>>>> * Tomcat 6.0.26 (stand alone)
>>>>>> * Red Hat Enterprise 5 (Linux 2.6.18-164.15.1.el5 on x86_64)
>>>>>> * IP-based virtual hosting
>>>>>> * Tomcat running as daemon via JSVC
>>>>>> * server.xml:
>>>>>>
>>>>>>       1.<Engine name="Catalina" defaultHost="firstdomain.com">
>>>>>>       2.
>>>>>>       3.<Connector port="80" protocol="HTTP/1.1"
>>>>>>       4.          connectionTimeout="20000"
>>>>>>       5.          redirectPort="443"
>>>>>>       6.          useIPVHosts="true" />
>>>>>>       7.
>>>>>>       8.<Connector address="1.2.3.4" port="443"
>>>>>>       9.
protocol="org.apache.coyote.http11.Http11Protocol"
>>>>>>      10.          SSLEnabled="true"
>>>>>>      11.          maxThreads="150" scheme="https" secure="true"
>>>>>>      12.          clientAuth="false" sslProtocol="TLS"
>>>>>>      13.          keystoreFile="/usr/share/tomcat/.keystore"
>>>>>>      14.          keystorePass="changeit" />
>>>>>>      15.
>>>>>>      16.<Connector address="5.6.7.8" port="443"
>>>>>>      17.
protocol="org.apache.coyote.http11.Http11Protocol"
>>>>>>      18.          SSLEnabled="true"
>>>>>>      19.          maxThreads="150" scheme="https" secure="true"
>>>>>>      20.          clientAuth="false" sslProtocol="TLS"
>>>>>>      21.          keystoreFile="/usr/share/tomcat/.keystore2"
>>>>>>      22.          keystorePass="changeit" />
>>>>>>      23.
>>>>>>      24.<Host name="firstdomain.com"
>>>>>>      25.
appBase="/home/websites/firstdomain.com/webapps"
>>>>>>      26.          unpackWARs="true"
>>>>>>      27.          autoDeploy="true">
>>>>>>      28.<Valve
className="org.apache.catalina.valves.AccessLogValve"
>>>>>>      29.
directory="/home/websites/firstdomain.com/logs"
>>>>>>      30.             prefix="firstdomain.com_access."
>>>>>>      31.             suffix=".log"
>>>>>>      32.             pattern="common"
>>>>>>      33.             resolveHosts="false"/>
>>>>>>      34.</Host>
>>>>>>      35.
>>>>>>      36.<Host name="seconddomain.com"
>>>>>>      37.
appBase="/home/websites/seconddomain.com/webapps"
>>>>>>      38.          unpackWARs="true"
>>>>>>      39.          autoDeploy="true">
>>>>>>      40.<Valve
className="org.apache.catalina.valves.AccessLogValve"
>>>>>>      41.
directory="/home/websites/seconddomain.com/logs"
>>>>>>      42.             prefix="seconddomain.com_access."
>>>>>>      43.             suffix=".log"
>>>>>>      44.             pattern="common"
>>>>>>      45.             resolveHosts="false" />
>>>>>>      46.</Host>
>>>>>>
>>>>>>
---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>>>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>              
>>>>>
>>>>>            
>>>>
---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>>
>>>>
>>>>          
>>>
>>>        
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>      
>
>    

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



*******************************  NOTICE  *********************************
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to