tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnny Kewl" <j...@kewlstuff.co.za>
Subject Re: multiple instances and context roots
Date Thu, 26 Jun 2008 21:35:54 GMT

----- Original Message ----- 
From: "Johnny Kewl" <john@kewlstuff.co.za>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Thursday, June 26, 2008 3:15 PM
Subject: Re: multiple instances and context roots


>
> ----- Original Message ----- 
> From: "tom_goring" <tom.goring@gmail.com>
> To: <users@tomcat.apache.org>
> Sent: Thursday, June 26, 2008 12:09 PM
> Subject: multiple instances and context roots
>
>
>>
>> Hi,
>>
>> I've posted this on the jboss forum but had no response... it's really a
>> tomcat question.
>>
>> jboss-4.2.2 (not sure of the tomcat version used)
>>
>> I have several jboss installs running behind apache using mod_jk (dev, 
>> test,
>> production, etc)
>>
>> I can't use virtual hosts as all my instances require SSL and this is 
>> only
>> set up for 1 domain. Each instance runs on it's own ports.
>>
>> I want a simple way to tell each jboss/tomcat instance to use a reliative
>> context.
>>
>> E.g.
>>
>> https://www.myserver.com/dev/MYAPP/hello.jsp
>> https://www.myserver.com/test/MYAPP/hello.jsp
>>
>> I.e. I want to know where I can set dev/test, etc.
>>
>> I don't really want to change the application.xml (context-root) for each
>> EAR file when installed (as that would require rebuilding the EAR 
>> dependent
>> on the instance).
>>
>> Ideas ?
>
> Tom, I have no knowledge of Jboss... we dont use EJB at all, so I'm just 
> going to tell you what TC does to get sub contexts, and then you on your 
> own.
>
> Say you want /dev/MyApp
> The context file name in conf/host  becomes
>
> dev#MyApp.xml
>
> The path in the context file becomes
>
> path="/dev/MyApp"/>
>
> And in webapps folder it becomes
>
> /dev/The UnPacked Webapp
>
> Deployment is not possible by dropping a war into tomcat... the war must 
> not be there, else TC will auto deploy and mess up your config.
>
> Then I "guess" JkMount /dev/*  theWorker.....  may work...
>
> And hopefully nothing in those apps is hardcoded... like URI's in jsp 
> pages etc.
> And EJB is still happy...
>
> Some really creative guy Alex Mestiashvili showed us a way (unrelated) to 
> map different IP's to different webapps a while back using a reverse proxy 
> and some other incredible rewrite stuff that Apache can do... JK works on 
> relative uri's, but I think its worth a bash asking the Apached guys if 
> one cant map
>
> https://www.myserver.com/dev/MYAPP/hello.jsp
> https://www.myserver.com/test/MYAPP/hello.jsp
>
> to
>
> https://www.myserver.com:8080/MYAPP/hello.jsp
> https://www.myserver.com:8081/MYAPP/hello.jsp
>
> etc...
>
> Or something even more creative... ie try get apache to present TC/JBoss 
> with something it likes...
> Maybe mod proxy has a few tricks that jk does not... worth getting into 
> the Httpd mailing list and asking, I think.
> JK is terrific at load balancing, but you just trying to use it as a kind 
> of gateway... Apached is probably good at that.
>
> Good luck.... sorry cant be more helpful
>
> ---------------------------------------------------------------------------
> HARBOR : http://www.kewlstuff.co.za/index.htm
> The most powerful application server on earth.
> The only real POJO Application Server.
> See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
> ---------------------------------------------------------------------------

After Thought...
Been thinking about the idea of mapping....

 https://www.myserver.com/dev/MYAPP/hello.jsp
 https://www.myserver.com/prod/MYAPP/hello.jsp

 to

 https://www.myserver.com:8080/MYAPP/hello.jsp
https://www.myserver.com:8081/MYAPP/hello.jsp

asked the Apache guys... maybe there is a guru out there with an alt plan, 
but I think it needs planning when making the WebApp
This will map incoming requests....

ProxyRequests Off

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass /dev http://localhost:8080
ProxyPassReverse /dev http://localhost:8080

ProxyPass /prod http://localhost:8081
ProxyPassReverse /prod http://localhost:8081

but the problem is that the actual links on your pages are going to still be

http://www.myserver.com/MYAPP/hello.jsp

so... one would have to plan for it and have say a context parameter that 
one could also set... so that it adjusts
page urls to /dev/MYAPP

The above mod proxy stuff... does this.... maps

domain/dev/MyApp
to
localhost:8080/MyApp

so the incoming is adjusted... which leaves getting your own links right... 
so maybe TC sub contexts and JK is the way to go...

Anyway, I dont think even the great Apache can fix this one, without a 
little fore planning.
... I think ;)

------------------
... now that .com .org. net is opening up?
tomcat.apache.org
could become
tomcat.apache.ThenMicrosoft ;)

or what about...

tomcat.apache.sun

ha ha

Its going to be chaos ;)
-----------------




---------------------------------------------------------------------
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


Mime
View raw message