Re: how to do auto redirection of a tomcat application

2011-02-24 Thread Tapas Mishra
On Thu, Feb 24, 2011 at 12:08 PM, Paul Graydon p...@paulgraydon.co.uk wrote:


 Yes we do, we use both rules in combination on probably most of the
 subdomains we host (approximately 70-80 applications under 20-30 subdomains)

 A few of our apps are named ROOT to allow them to work from /, but in most
 cases we'll have multiple apps for a particular subdomain so they have
 distinctive names.
So in that case those apps must also be generating URL at context root
/app1 and relative to it.
If 2 of your applications start generating URIs which begin with / and
not /app1 or /app2
then I think even you will need a different ServerName or DNS entry so
that send that request which forwards the root of site in ProxyPass to
internal machine.
I am very sure this situation depends upon how the application is
generating URLs.

-- 
http://mightydreams.blogspot.com

-- 
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam


how to do auto redirection of a tomcat application

2011-02-23 Thread Tapas Mishra
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@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.

-- 
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam


Re: how to do auto redirection of a tomcat application

2011-02-23 Thread Paul Graydon

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@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), so your mileage 
may vary depending on if ajp does anything unusual in relation to 
ProxyPass.  You may find its as simple as doing this:


ProxyPass / ajp://192.168.1.19:8009/olat
ProxyPassReverse / ajp://192.168.1.19:8009/olat

However, it depends on the java app underneath it.  Some of the apps we 
run in our tomcat hosting environment can be picky if the URI (bit after 
the first / after the domain in the URL) is different from what the 
application expects.  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

That means when someone browses to http://social.openitup.in/ they will 
automatically be redirected to http://social.openitup.in/olat


Paul

--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam


Re: how to do auto redirection of a tomcat application

2011-02-23 Thread Tapas Mishra
On Thu, Feb 24, 2011 at 3:53 AM, Paul Graydon p...@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@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

-- 
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam


Re: how to do auto redirection of a tomcat application

2011-02-23 Thread Paul Graydon

On 2/23/2011 7:36 PM, Tapas Mishra wrote:

On Thu, Feb 24, 2011 at 3:53 AM, Paul Graydonp...@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@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.
Yes we do, we use both rules in combination on probably most of the 
subdomains we host (approximately 70-80 applications under 20-30 subdomains)


A few of our apps are named ROOT to allow them to work from /, but in 
most cases we'll have multiple apps for a particular subdomain so they 
have distinctive names.  RewriteRule is usually used in combination with 
ProxyPass to direct traffic appropriately if they come in at the wrong 
point.


Paul

Paul

--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam