how to do auto redirection of a tomcat application
Tapas Mishra
mightydreams at gmail.com
Thu Feb 24 05:36:53 UTC 2011
On Thu, Feb 24, 2011 at 3:53 AM, Paul Graydon <paul at paulgraydon.co.uk> wrote:
> On 02/23/2011 11:30 AM, Tapas Mishra wrote:
>>
>> I have a site http://social.openitup.in
>> right now what you are seeing is a default Tomcat6 page.
>> I am using mod_ajp as a front end and Apache vhost configuration for same
>> is
>>
>> <VirtualHost *:80>
>>
>> ServerName social.openitup.in
>> ServerAdmin webmaster at localhost
>>
>> ProxyRequests off
>> <Proxy *>
>> Order deny,allow
>> Allow from all
>> </Proxy>
>> ProxyPreserveHost On
>>
>> ProxyPass / ajp://192.168.1.19:8009/
>> ProxyPassReverse / ajp://192.168.1.19:8009/
>>
>>
>> </VirtualHost>
>>
>>
>>
>>
>> How ever I have an application running on it
>> http://social.openitup.in/olat
>> what I want to do is when some one opens
>> http://social.openitup.in
>> then rather than seeing Tomcat6 home page from
>> /var/lib/tomcat6/webapps/ROOT/index.html
>> the person is redirected to olat application which is in
>> /var/lib/tomcat6/webapps/olat
>> how can this be achived?
>>
>> The machine where OLAT is and where the above Reverse Proxy
>> configuration is are physically different machines.
>>
> Hi Tapas,
>
> We're using straight http, rather than ajp for proxying to our tomcat
> servers (though I'm hoping to transition at some stage),
Ok so the rule which you mentioned
> What we tend to do is use a rewrite:
>
> RewriteEngine On
> RewriteRule ^/$ /olat/ [redirect,last]
>
> The have our proxypass lines:
>
> ProxyPass /olat ajp://192.168.1.19:8009/olat
> ProxyPassReverse /olat ajp://192.168.1.19:8009/olat
>
you use RewriteRule in combination with ProxyPass.
I just want to know this for sake of understanding.
I solved the current problem by renaming the application in webapps
/var/lib/tomcat6/webapp/olat to
/var/lib/tomcat6/webapp/ROOT
and it worked you can check http://olat.openitup.in
let me know if you use ReWriteRule in combination with ProxyPass directive.
--
http://mightydreams.blogspot.com
More information about the ubuntu-server
mailing list