You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rashmi Rubdi <de...@yahoo.com> on 2006/11/11 12:12:13 UTC

How do I enable HTTP Sessions after setting up Virtual Hosts?

I have 2 separate projects set up as virtual hosts 
http://projectA:8080/
http://projectB:8080/
so that each of them can be
run from the ROOT context in the development environment. Just to make it easier to
switch between them.

HTTP Session was working before I set up Virtual Hosts on Tomcat 5.5/ Windows XP.

The entries in server.xml :

<Engine name="Catalina" defaultHost="projectA">

      <Host name="localhost" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
      </Host>

      <Host name="projectA" appBase="webapps/projectA">
         <Context path="/" docBase="C:/dev/projects/projectA/__source" reloadable="true" />
        <Logger className="org.apache.catalina.logger.FileLogger"/>
      </Host>

      <!--
      <Host name="projectB" appBase="webapps/projectB">
        <Context path="/" docBase="C:/dev/projects/projectB/__source" reloadable="true" />
        <Logger className="org.apache.catalina.logger.FileLogger"/>
      </Host>    
      -->

</Engine>


I came accross this thread which was created in 2003, but there were no replies on it:
http://mail-archives.apache.org/mod_mbox/tomcat-users/200302.mbox/%3C000001c2d0cb$89d4d340$6501a8c0@tartarus%3E

I also searched around but couldn't find any documentation regarding this issue. The only documentation that seems
applicable is http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html But, I don't know enough about clustering/load balancing 
and I don't think I need to set up a Cluster for my set up at the moment. But please correct me if I'm wrong.

If I can't get sessions to work then I might have to switch back to the old set-up with no virtual hosts where I have a ROOT.xml for each project under
C:\dev\apache-tomcat-5.5.12\conf\Catalina\localhost\

Any help is appreciated.



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How do I enable HTTP Sessions after setting up Virtual Hosts?

Posted by Hassan Schroeder <ha...@gmail.com>.
On 11/11/06, Rashmi Rubdi <de...@yahoo.com> wrote:

> HTTP Session was working before I set up Virtual Hosts on Tomcat 5.5/ Windows XP.

?? And exactly how is it not working now? What's the test case?

> The entries in server.xml :

>       <Host name="projectA" appBase="webapps/projectA">
>          <Context path="/" docBase="C:/dev/projects/projectA/__source"

Dunno if it's related but that Context path is wrong -- should be ""
(null path) for the default Context. (Just guessing that it might cause
a mismatched path in the session cookie.) So fix that first. :-)

-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org