You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Dan D." <da...@dubomail.com> on 2007/06/14 02:34:05 UTC

mod_jk along side mod_dir -- How to get PHP to be seen as a default page

Hello,

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.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: mod_jk along side mod_dir -- How to get PHP to be seen as a default page

Posted by Mark Thomas <ma...@apache.org>.
Dan D. wrote:
> Hello,
<snip />

When starting a new thread (ie sending a message to the list about a
new topic) please do not reply to an existing message and change the
subject line. This is known as thread hijacking and to many of the
list archiving services and mail clients used by list subscribers this
makes your new message appear as part of the old thread. This makes it
harder for other users to find relevant information when searching the
lists.

It should also be noted that many list subscribers automatically
ignore any messages that hijack another thread.

The correct procedure is to create a new message with a new subject.
This will start a new thread.

Thanks,

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org