But first I think I need to explain a bit more about our setup. This is what our directory structure looks like:
/www/
/htdocs/
/examples1/
/examples2/index.html
/examples3/index.jsp
/WEB-INF/web.xml
/webapps/
/webapp1/index.jsp
/webapp2/index.jspNow 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:
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>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?
-- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
