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 Thu, 06 Jan 2005 12:30:29 GMT
Mladen Turk wrote:
> Dennis Lundberg wrote:
>> /www/
>>     /htdocs/
>>            /examples1/
>>            /examples2/index.html
>>            /examples3/index.jsp
>>            /WEB-INF/web.xml
>>     /webapps/
>>             /webapp1/index.jsp
>>             /webapp2/index.jsp
>> 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"/>
>> 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 possible?
> Yes.
> JkMount /examples3/* yourworker
> Then:
> JkUnMount /examples3/*.jpg yourworker
> ...
> JkUnMount /examples3/*.xxx yourworker
> But that's not the very wise solution.
> You obviously wish to Apache serve your static content (e.g. images),
> while Tomcat serving the dynamic content.
> So, organize your applications like that, moving static content to
> a virtual space accesible only by Apache.
> For example:
> Make /images Alias for apache in some directory outside
> Tomcat ROOT.
> Mladen.

The thing is that we don't want to organize our content depending on 
whether it will be served by Apache httpd or Tomcat. That is something 
that our webeditors should not need to know about. That is also the 
reason for having a shared DocumentRoot/Root-context.

This works in mod_jk 1.2.4. Somewhere on the way to 1.2.5 something 
changed that broke this functionality. Looking in CVS i found that 
revision 1.78 [1] has a comment about DirectoryIndex handling. 
Unfortunately it's been too long since I programmed any C so I'm at a 
loss to understand what really happened there.

I think I understand why we decided to add index.jsp to our 
DirectoryIndex directive now. That reason is what it would allow Apache 
httpd to "check" if there is an index.jsp file available in a folder. 
Given a DirectoryIndex directive like this:
   DirectoryIndex index.jsp index.html
it's my understanding that Apache httpd does this when it receives a 
request for say /examples4/ is this:

- Look in the DirectoryIndex directive to see what files should be checked.
- Does /examples4/index.jsp exist? If yes follow the JkMount directive 
and turn over processing to Tomcat.
- Does /examples4/index.html exist? If yes serve that file.
- No more DirectoryIndex files to process. Check if directory listings 
are allowed. If yes show a directory listing, if no show an error page.

It seems to me that when Apache httpd tries to see if the file index.jsp 
exists, processing is turned over to Tomcat and doesn't return to httpd. 
Is that correct? My feeling is that Apache httpd should be allowed to 
see if the file exists before turning over processing to Tomcat.

On another note, I've stumbled upon a few errors in the connectors 
documentation after doing some serious reading to understand all this. 
How to I go about contributing patches? Should I open an issue in 
buzilla for the product "Tomcat5" and add patches to that?

Dennis Lundberg

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

View raw message