Hello,

First, my apologies for inadvertently hijacking a previous thread.  Long time 
reader, first time poster.  Won't happen again.

Now, First the versions:
Apache : 1.3.33
Tomcat: 6.0.13
mod_jk: 1.2.23

I am currently working on upgrading our environment to a newer version of 
Tomcat and mod_jk, and seem to be running into an issue with mod_jk and 
mod_dir.  More specifically, the issue I am running into is the default file 
list.

As I understand, it is intended behavior for the Apache DirectoryIndex 
directive to be more or less ignored, and instead the <welcome-file-list /> 
directive in web.xml is used to determine which files are loaded and in 
which order by default.

Now, the issue I run into is that I do not know in advance what our 
customers will be loading on their site.  There is a very real possibility 
that they may have an index.php file, which we want to have load first. 
This is something that I want to have Apache load, instead of Tomcat 
attempting to parse it, since we run php in a sandbox (suPHP).

Everything I have attempted, ends up basically the same when attempting to 
view a site by the hostname only (ie., http://hostname.tld/)

If I add
    <welcome-file>index.php</welcome-file>
to the <welcome-file-list> in my web.xml, it simply asks me to download the 
php file, instead of it being parsed by Apache.

If it is not in the welcome-file-list, it simply goes to the next one that 
is (index.html) and is still parsed by Tomcat, not Apache.

The related Apache Jk settings are as follows:


In addition, after the mod_jk include, but prior to any Jk settings, I have 
the following:


LoadModule dir_module           libexec/mod_dir.so
LoadModule jk_module            libexec/mod_jk.so

<IfModule mod_dir.c>
    DirectoryIndex default.html default.htm index.php index.shtml index.html 
index.htm home.html home.htm welcome.html index.jsp
</IfModule>
<Location "/">
        SetEnvIf REQUEST_URI ^/(.*)/*.php$ no-jk
        SetEnvIf REQUEST_URI ^/(.*)/*.html$ no-jk
</Location>

JkWorkersFile /web/conf/workers.properties
JkUnMount /*.php local
JkMountFile /web/conf/uriworkermap.properties
JkLogFile /web/logs/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat     "%w %V %U %T"

The contents of workers.properties are:

worker.list=local,jkstatus
# Set properties for worker1 (ajp13)
worker.local.type=ajp13
worker.local.host=localhost
worker.local.port=8009
worker.local.lbfactor=1
worker.jkstatus.type=status
worker.local.mount=/ /*



The contents of uriworkermap.properties are:
#exclude extensions
!*.html=local
!*.php=local


I understand that there are a few settings that are redundant, but I have 
tried every "don't touch php, tomcat" setting I can find, and it is still 
attempting to parse it.

Also a thing to note.  This only happens when attempting to view the default 
page.  If I browse directly to http://hostname.tld/index.php, it works fine.

So, my question is, how do I either prevent Tomcat from handling these 
requests, or tell it to pass them back to Apache if it doesn't know what to 
do with them?

I thank you for your time and help in this matter,

Dan D.

Reply via email to