[CLUE-Tech] apache redirect to another directory on same server.

Jeffery Cann fabian at jefferycann.com
Tue Jul 1 21:28:56 MDT 2003


On Tuesday 01 July 2003 08:19 pm, David Anselmi wrote:
> Why?  Obviously you don't want Apache serving out of /.  You want it
> serving out of /webapp which is what the doc root is for.

Because when I tried to do this:

 + DocumentRoot /var/tomcat4/webapps/webapp/

Apache does not send the request for http://www.example.com/ to ajp13 handler 
in tomcat (mod_jk).  What apache does do is spit back the text version of my 
jsp (oops).

I guess that the reason it does not work is the way mod_jk gets automatically 
configured by tomcat for each web application's context.  In my case, going 
directly to tomcat (8080), I use http://www.example.com:8080/webapp/, since 
the application is configured in tomcat as /webapp.

I suppose I could reconfigure my webapp to run from the / context in tomcat.  
But, there are many other changes to the configuration and jsp files that 
make this an unpleasant change.  Chalk it up to 'learning experience' :)

> The reason Alias doesn't loop is that Apache does the translation 
> internally figuring out what to serve to your request.  With Redirect 
> the browser makes a new request that is subject to redirection.

I tried alias.  It also does the same thing as the DocumentRoot change, 
probably for the same reasons.

I'll check the tomcat-users list and report back.

Thanks for the suggestions!
Jeff
-- 
"Keep yourselves far from every form of exaggerated nationalism, racism and 
intolerance."
-- Pope John Paul II 



More information about the clue-tech mailing list