tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: http and/or ajp connectors
Date Wed, 18 Nov 2009 22:14:06 GMT
Jeffrey Trimble wrote:
> To answer a few questions:
> 
> I'm running apache and tomcat on the same server (AIX).  I'm also 
> running VIPA (Virtual IP Addresses)
> under AIX.  So, I have apache serving up one IP address (Vhost) without 
> the need for tomcat on
> port 80.  It serves up some documentation for users.
> 
> The second IP/Vhost is running DSpace software.  DSpace runs off Tomcat, 
> but there are several
> webapps that can run under the DSpace/Tomcat servlets.  Here's the rundown:
> 
> http://digital.maag.ysu.edu:8080/jspui     (JSP front end)
> http://digital.maag.ysu.edu:8080/xmlui    (Running xmlui interface/cocoon)
> http://digital.maag.ysu.edu:8080/oai       (Harvester)
> http://digital.maag.ysu.edu:8080/sword    (Another interface for 
> specific uploads--we aren't using currently)
> 
> As you can see I'd like to do TWO things here:
> 
> 1.    Remove the port issue if possible--makes it simpler on users and 
> shorter too.
> 
> 2.    Redirect http://digitial.maag.ysu.edu to 
> digital.maag.ysu.edu/jspui interface and keep the other interfaces.
> 
> Does this help analyze the situation?  Currently, I've just kept a 
> simple redirect for digital.maag.ysu.edu
> to the first example in the list.
> 
Going back then to your original post :
 >
 > redirect "/" "http"//digital.maag.ysu.edu/jspui"
 >
That one, you drop, because it is the one that caused your original 
endless loop.

 > Then I had a ProxyPass in the httpd.conf file:
 >
 > ProxyPass /jspui http://digital.maag.ysu.edu/jspui
 > ProxyPassReverse /jspui http://digital.maag.ysu.edu/jspui

Old African proverb : to eat an elephant, one has to do it a little bit 
at a time.

So first issue # 1 :

Just do this in Apache httpd :
 > ProxyPass /jspui http://digital.maag.ysu.edu:8080/jspui
 > ProxyPassReverse /jspui http://digital.maag.ysu.edu:8080/jspui

and do similar things for your other webapps, like
 > ProxyPass /xmlui http://digital.maag.ysu.edu/xmlui
etc..

(In other words, whatever comes in into Apache on port 80, you proxy to 
Tomcat on its currently configured port 8080.  To the user, it appears 
that everything is answered by Apache httpd, thus on the default port 
80, which being the default, does not need to be specified in the URL)


Once that is working, to tackle issue # 2, the fact that you would 
apparently like to have it so that if a user requests :
http://digital.maag.ysu.edu/
they would in fact be directed to Tomcat's "/jspui" webapp, you can use 
either one of two methods :

1)
1a) make "/jspui" become your "default" Tomcat application.
For that, you have to rename it to ROOT.  There are plenty of 
explanations available about this in previous threads on this list, or 
else there is a superb tutorial about it in the FAQ.
(http://wiki.apache.org/tomcat/HowTo  , see #38)
The end result will be that, for Tomcat, your former "/jspui" 
application will now respond to the URL
http://digital.maag.ysu.edu:8080/
1b) of course you then need to change your ProxyPass directive, so that 
Apache would proxy to Tomcat's new default application, the URL
http://digital.maag.ysu.edu/  (in other words, "/")
That is left as an exercise to the reader.
(But, if you do a ProxyPass of "/", make sure you put that one as the 
last ProxyPass, to give the others a chance).


OR

2) use mod_rewrite under Apache, to rewrite the URL
http://digital.maag.ysu.edu/ (in other words, "/")
to
http://digital.maag.ysu.edu/jspui
and then just proxy this to Tomcat like above.

This is all assuming that in your Apache VirtualHost for 
"digital.maag.ysu.edu", you just proxy everything to Tomcat, and do not 
want, with this VirtualHost, to serve anything directly from Apache.



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


Mime
View raw message