tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Lundberg <>
Subject Re: [mod_jk] Unable to get directory listings from Apache httpd 2 for versions 1.2.5 and above
Date Wed, 05 Jan 2005 21:34:16 GMT
Thank you Mladen for your quick response. I think I understand things 
more clearly now. One must keep the httpd stuff separate from the Tomcat 
stuff. It's working better now, but there is one thing that I can't get 
to work like I would like it to.

But first I think I need to explain a bit more about our setup. This is 
what our directory structure looks like:


Now httpd is set up like this:
DocumentRoot "/www/htdocs"

Tomcat has a context configured like this:
<Context path="" docBase="/www/htdocs" debug="0" reloadable="true"/>

As you can see the ROOT context in Tomcat is the same directory as the 
DocumentRoot in httpd. The reason for this setup is this:
- We want to use a couple of jsp:s in the DocumentRoot like the file 
/examples3/index.jsp above. These files are managed by the same people 
that write our html-pages. We don't want to let these web-writers into 
the webapps-subdirectory.

I have made the change you suggested:
   Removed index.jsp from the DirectoryIndex directive.
I also added the following to /www/htdocs/WEB-INF/web.xml:

The thing that didn't work before now works :-) , but one thing that 
used to work before is now broken :-( Trying the URL:s in the directory 
structure above gives these results:

- Accesses to /examples1/ (Apache httpd shows a directory listing)
- Accesses to /examples2/ (Apache httpd serves the file index.html)
- Accesses to /examples3/index.jsp (Tomcat serves the file index.jsp)
- Accesses to /examples3/ (Apache httpd shows a directory listing)

The first three work as can be expected. It's the last one that puzzles 
me. I would like Tomcat to serve me the file index.jsp there. Is that 

Dennis Lundberg

Mladen Turk wrote:
> Dennis Lundberg wrote:
>> *Problems:*
>> With mod_jk 1.2.4 this works as expected. With versions 1.2.5, 1.2.6 
>> and 1.2.8, number 3 above doesn't work. A request for /examples/ 
>> returns a 404 from Tomcat. Looking in the mod_jk log shows that it is 
>> trying to serve the file index.jsp, but that file doesn't exist. It 
>> should have returned a directory listing because no valid index-file 
>> (index.jsp, index.shtml or index.html) was found.
> Do not use DirectoryIndex index.jsp.
> It's up to Tomcat to decide what will be the default context for
> any web application.
>> *Configuration snippets*
>> httpd.conf
>>     Options Indexes Includes
>>     DirectoryIndex index.jsp index.shtml index.html
> You can serve only application that are listed in the server.xml,
> so what would be the purpose of DirectoryIndex index.jsp anyhow?
>>     ...
>>     JkMount /*.jsp connector80
>>     JkMount /webapp1/* connector80
>>     JkMount /webapp2/* connector80
>>     ...
>> We've also tried some of the new mod_jk directives forwards and 
>> backwards including these:
>>     JkOptions -ForwardDirectories
>>     JkOptions +ForwardDirectories
>> Is there something wrong with our setup, our is there a bug in mod_jk? 
> Yes like said apache forwards the requests to tomcat over the wire.
> It's up to Tomcat to decide what content it will serve.
> Using DirectoryIndex the Apache is trying
> /examples/index.jsp -> 404 from Tomcat if index.jsp does not exist.
> This is common perception problem. Tomcat is not PHP where you can
> feed the physical file to its engine, so entire DirectoryIndexing
> concept is useless from Tomcat point of view.
> Mladen.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message