tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oli Gauti Gudmundsson <>
Subject Tomcat 4.01 + Apache 1.3 + mod_webapp: problem with root context
Date Wed, 16 Jan 2002 20:43:04 GMT
Hey everyone.
I've been looking for a solution to my problem for two days now, scanning
through the archives without any luck. So, I'm hoping someone here can help
Following are the specs of my system:
Tomcat 4.01
Apache 1.3
JDK 1.2
Solaris 7
I built Apache and mod_webapp, and Tomcat now successfully serves up dynamic
content through Apache.
Before I can describe the problem, I'll have to give you some background
The first thing you need to know, is that I have a number of domain names
all pointing to the same IP address (,, etc.). Apache listens on that IP address, and the same
web application serves all those domain names. The thing is that my web
application responds differently to the different domain names. For example
if the user goes to in his browser, he gets a different
looking page than if he would go to The web
application selects the right content by reading the hostname.
The second thing you need to know, is that the webapp runs in the root
Now, I've put the following lines into my httpd.conf:
WebAppConnection conn warp localhost:8044
WebAppDeploy mywebapp conn /

(and yes, I deliberately changed the warp port to 8044 for reasons that are
not the subject of this discussion). Also the ServerName in httpd.conf is
set to the IP address of the server.
Let's say that my IP address is Now, if I point my browser to <> , the webapplication serves up
dynamic content. But if I point it to
<>  (which is pointing to, it
redirects me to <> . The same goes
for, etc. 
And things get even stranger. If I include the index.jsp in the path, then
the server does not redirect!!! That is, if I point the browser to
<>  (appending the "/index.jsp"), then
Apache does not redirect and the webapp can serve the correct content.
This just started to happen after I upgraded Tomcat from 3.2 using mod_jserv
to Tomcat 4.01 using mod_webapp.
I know that you can add virtual hosts in httpd.conf, but that is an
unacceptable solution for me, because the httpd.conf should not be edited if
a new domain name is added.
I need some workaround for this, so that the hostname that the user inputs
stays the same.
If you can think of a solution, please bear in mind that it must fulfill the
following requirements:
1. The webapp MUST run in the root context.
2. The Apache httpd.conf SHOULD NOT HAVE TO BE EDITED if a new domain name
pointing to the IP address of the server is added.
Any help is greatly appreciated.

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