tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kennedy" <mkenn...@oucpm.org>
Subject Multiple hosts pointing to different index files for one webapp
Date Tue, 07 Jun 2011 15:32:03 GMT
I have been asked to launch a new webapp in Tomcat via different URLs, with
each URL pointing to a different launch page for the same app. For example:

portal1.com --> webapps/portalapp/portal1_index.jsp

portal2.com --> webapps/portalapp/portal2_index.jsp

 

I don't know if this should be done by the app itself, or if there is a
simple/complicated way to do it in Tomcat. I have researched through the
O'Reilley Tomcat book, tomcat docs, and various forums, and have not found
any config documentation to do it. A welcome-file specification in the app's
web.xml doesn't seem to cut it, and I have tried to rig an Apache proxy but
still cannot get the right index file to be called first. Likely I just do
not fully understand some settings in Tomcat or Apache to do this right
(perhaps 'appBase' under <Host> or 'path' and 'docBase' under <Context> can
be used), hence I come to you. Any assistance is much appreciated. I hope my
description is clear; if there is more info/config stuff I can post let me
know.

 

I am running Tomcat 5.5.23 and Apache 2.2.3 on Redhat Linux 5, with
jdk-1.6.0_07-fcs. Here are some relevant sections of my configs that get me
as close as I have come. I can launch the app by domain URL, but not without
still specifying the index page in the URL (http://portal1.com/ won't work,
have to use http://portal1.com/portal1_index.jsp).

 

from server.xml:

<Host name="portal1.com" appBase="webapps/portal"

       unpackWARs="true" autoDeploy="true"

       xmlValidation="false" xmlNamespaceAware="false">

       <Context path="" docBase="."

       debug="0" reloadable="false"/>

      </Host>

 

from httpd.conf:

 

<VirtualHost ipaddr:80>

DocumentRoot /var/www/html/portal1

ServerName portal1.com

<Directory "/var/www/html/portal1/">

allow from all

Options -Indexes

</Directory>

DirectoryIndex portal1_index.jsp

# Added to proxy for Tomcat

ProxyRequests Off

<Proxy *>

Order deny,allow

Allow from all

</Proxy>

ProxyPass / http://portal1.oucpm.org:8080/

ProxyPassReverse / http://portal1.oucpm.org:8080/

ProxyVia On

ProxyPreserveHost Off

</VirtualHost>

 

Again, many thanks for your consideration.

-Mike

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message