Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 88504 invoked from network); 6 Oct 2008 17:54:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Oct 2008 17:54:46 -0000 Received: (qmail 76599 invoked by uid 500); 6 Oct 2008 17:54:33 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 76571 invoked by uid 500); 6 Oct 2008 17:54:33 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 76559 invoked by uid 99); 6 Oct 2008 17:54:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Oct 2008 10:54:33 -0700 X-ASF-Spam-Status: No, hits=-3.9 required=10.0 tests=DNS_FROM_SECURITYSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [192.85.154.83] (HELO ahmler9.mail.eds.com) (192.85.154.83) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Oct 2008 17:53:29 +0000 Received: from ahmlir5.mail.eds.com (ahmlir5-2.mail.eds.com [192.85.154.135]) by ahmler9.mail.eds.com (8.14.2/8.13.8) with ESMTP id m96Hs45N028244 for ; Mon, 6 Oct 2008 13:54:04 -0400 Received: from ahmlir5.mail.eds.com (usahsdlp305.amer.corp.eds.com [130.175.222.184] (may be forged)) by ahmlir5.mail.eds.com (8.13.8/8.12.10) with ESMTP id m96Hs3Hq023771 for ; Mon, 6 Oct 2008 13:54:04 -0400 Received: from ahmlir5.mail.eds.com (localhost [127.0.0.1]) by ahmlir5.mail.eds.com (8.13.8/8.12.10) with ESMTP id m96Hrojm022737 for ; Mon, 6 Oct 2008 13:53:50 -0400 Received: from usahm015.amer.corp.eds.com ([130.175.198.25]) by ahmlir5.mail.eds.com (8.13.8/8.12.10) with ESMTP id m96HroI0022728 for ; Mon, 6 Oct 2008 13:53:50 -0400 X-EDSINT-Source-Ip: 130.175.198.25 Received: from usplm212.amer.corp.eds.com ([148.94.166.22]) by usahm015.amer.corp.eds.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 6 Oct 2008 13:53:50 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: RE: Apache DirectoryIndex and mod_jk ForwardDirectories not playing nicely Date: Mon, 6 Oct 2008 12:56:47 -0500 Message-ID: In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: thread-topic: Apache DirectoryIndex and mod_jk ForwardDirectories not playing nicely thread-index: Ackk6cB+3U3qcd18Tsi7mpVgzGdMPQC8ob2w References: From: "Townsley, Charlotte" To: "Tomcat Users List" X-OriginalArrivalTime: 06 Oct 2008 17:53:50.0403 (UTC) FILETIME=[7D3A4930:01C927DC] X-CFilter-Loop: Reflected X-Virus-Checked: Checked by ClamAV on apache.org Hello all,=20 I haven't received any replies, probably because I didn't explain the problem very clearly.=20 =20 I created a "band aid" for the problem I encountered with mod_jk and apache not handling DirectoryIndex correctly. Essentially I used mod_rewrite to check for index.shtml and pass to index.page when needed. If anyone has any other ideas, please let me know. This is not my area of expertise.=20 Here is what I did with mod_rewrite: __________________________________________ These two lines are the existing mod rewrites. It just disables TRACE and TRACK HTTP methods as a security precaution. RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) RewriteRule .* - [F] ____________________________________________ These next three are for directory requests: line 1: if DocRoot/Requested-File is a directory line 2: and if DocRoot/Requested-Directory does not contain index.shtml line 3: rewrite request to Requested-Directory/index.page =20 RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME}//index.shtml !-f RewriteRule / %{REQUEST_URI}index.page [L,NC,QSA,R=3D301] ______________________________________________ And these two handle the default document when index.shtml does not exist. line 1: if DocRoot/EDS/index.shtml does not exist line 2: and request is "/", then rewrite request for "EDS/index.page"=20 =20 RewriteCond %{DOCUMENT_ROOT}/EDS/index.shtml !-f RewriteRule ^/$ %{REQUEST_URI}EDS/index.page [L,NC,QSA,R=3D301] =20 ______________________________________________ The downside for this is our virtual Host entries have grown with the addition of the rules. =20 =20 ServerAdmin admin@domain.com DocumentRoot /cust/IBMHttpServer/htdocs/egov ServerName www.domain.us ScriptAlias /cgi-bin /cust/IBMHttpServer/cgi-bin DirectoryIndex /EDS/index.shtml CheckSpelling off RewriteEngine on RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) RewriteRule .* - [F] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME}//index.shtml !-f RewriteRule / %{REQUEST_URI}index.page [L,NC,QSA,R=3D301] RewriteCond %{DOCUMENT_ROOT}/EDS/index.shtml !-f RewriteRule ^/$ %{REQUEST_URI}EDS/index.page [L,NC,QSA,R=3D301] JkMount /*.page ajp13 JkOptions -ForwardDirectories Charlotte Townsley Information Analyst - Web Developer=20 -----Original Message----- From: Townsley, Charlotte [mailto:charlotte.townsley@eds.com]=20 Sent: Thursday, October 02, 2008 5:18 PM To: users@tomcat.apache.org Subject: Apache DirectoryIndex and mod_jk ForwardDirectories not playing nicely =20 =20 I'm trying to configure mod_jk 1.2.16.with Apache 1.3.26 and tomcat 5.0.28 on Solaris 9. I compiled the mod_jk from source for the Apache version. Unfortunately, I'm stuck with this environment.=20 =20 Behavior with mod_jk ForwardDirectories: =20 When index.shtml exists *=09 GOOD http://www.domain.com/EDS/index.shtml -> Loads as desired *=09 GOOD http://www.domain.com/EDS/index.page -> Loads as desired *=09 FAIL http://www.domain.com/EDS -> Pulls index.page from Tomcat, ignoring Apache DirectoryIndex *=09 FAIL http://www.domain.com/EDS/ -> Pulls index.page from Tomcat, ignoring Apache DirectoryIndex *=09 FAIL http://www.domain.com/ -> Displays Tomcat site chooser, ignoring Apache DirectoryIndex (which would display EDS/index.shtml)=20 And now when index.shtml does not exist * GOOD http://www.domain.com/EDS -> Pulls index.page from Tomcat, ignoring Apache DirectoryIndex=20 * GOOD http://www.domain.com/EDS/ -> Pulls index.page from Tomcat, ignoring Apache DirectoryIndex=20 * GOOD http://www.domain.com/ -> Displays Tomcat site chooser, ignoring Apache DirectoryIndex (which would display EDS/index.shtml) Behavior without mod_jk ForwardDirectories option: =20 When index.shtml exists *=09 GOOD http://www.domain.com/EDS/index.shtml -> Loads as desired *=09 GOOD http://www.domain.com/EDS/index.page -> Loads as desired *=09 GOOD http://www.domain.com/EDS -> Pulls index.shtml from Apache DirectoryIndex *=09 GOOD http://www.domain.com/EDS/ -> Pulls index.shtml from Apache DirectoryIndex *=09 GOOD http://www.domain.com/ -> Displays /EDS/index.shtml And now when index.shtml does not exist *=09 FAIL http://www.domain.com/EDS -> Apache Access Denied error (does not send request for directory "EDS" to Tomcat) *=09 FAIL http://www.domain.com/EDS/ -> Apache Access Denied error (does not send request for directory "EDS" to Tomcat) *=09 FAIL http://www.domain.com/ -> Apache Access Denied error (does not send request for directory "EDS" to Tomcat) Relevant apache configuration: LoadModule jk_module libexec/mod_jk.so.0.0.0 JkWorkersFile /cust/IBMHttpServer/conf/jk/worker.properties JkShmFile /cust/IBMHttpServer/logs/mod_jk.shm JkLogFile /cust/IBMHttpServer/logs/mod_jk.log JkLogLevel debug JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " JkMount /*.page ajp13 JkOptions +ForwardDirectories =20 DocumentRoot /cust/IBMHttpServer/htdocs/data ServerName www.domain.com ScriptAlias /cgi-bin /cust/IBMHttpServer/cgi-bin DirectoryIndex /EDS/index.shtml CheckSpelling off RewriteEngine on RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) RewriteRule .* - [F] JkMount /*.page ajp13 =20 =20 mod_jk.log log entries for a request '/EDS/' when 'index.shtml' should be displayed from the Apache DocumentRoot: =20 [Thu Oct 02 17:05:37 2008] [24767:0] [debug] map_uri_to_worker::jk_uri_worker_map.c (682): Attempting to map URI '/EDS/' from 1 maps [Thu Oct 02 17:05:37 2008] [24767:0] [debug] find_match::jk_uri_worker_map.c (503): Attempting to map context URI '/*.page=3Dajp13' source 'JkMount' [Thu Oct 02 17:05:37 2008] [24767:0] [debug] jk_translate::mod_jk.c (2868): no match for /EDS/ found [Thu Oct 02 17:05:37 2008] [24767:0] [debug] map_uri_to_worker::jk_uri_worker_map.c (682): Attempting to map URI '/EDS/index.shtml' from 1 maps [Thu Oct 02 17:05:37 2008] [24767:0] [debug] find_match::jk_uri_worker_map.c (503): Attempting to map context URI '/*.page=3Dajp13' source 'JkMount' [Thu Oct 02 17:05:37 2008] [24767:0] [debug] jk_translate::mod_jk.c (2868): no match for /EDS/index.shtml found [Thu Oct 02 17:05:37 2008] [24767:0] [debug] jk_fixups::mod_jk.c (2947): ForwardDirectories on: /EDS/ [Thu Oct 02 17:05:37 2008] [24767:0] [debug] map_uri_to_worker::jk_uri_worker_map.c (682): Attempting to map URI '/EDS/' from 1 maps [Thu Oct 02 17:05:37 2008] [24767:0] [debug] find_match::jk_uri_worker_map.c (503): Attempting to map context URI '/*.page=3Dajp13' source 'JkMount' [Thu Oct 02 17:05:37 2008] [24767:0] [debug] jk_translate::mod_jk.c (2772): Manual configuration for /EDS/ ajp13 [Thu Oct 02 17:05:37 2008] [24767:0] [debug] wc_get_worker_for_name::jk_worker.c (115): found a worker ajp13 [Thu Oct 02 17:05:37 2008] [24767:0] [debug] wc_maintain::jk_worker.c (323): Maintaining worker ajp13 [Thu Oct 02 17:05:37 2008] [24767:0] [debug] wc_get_name_for_type::jk_worker.c (292): Found worker type 'ajp13' [Thu Oct 02 17:05:37 2008] [24767:0] [debug] init_ws_service::mod_jk.c (865): Service protocol=3DHTTP/1.1 method=3DGET host=3D(null) addr=3D71.245.103.180 n ame=3Dwww.domain.com port=3D80 auth=3D(null) = user=3D(null) laddr=3D10.5.128.143 raddr=3D10.20.20.20 uri=3D/EDS/ [Thu Oct 02 = 17:05:37 2008] [24767:0] [debug] ajp_get_endpoint::jk_ajp_common.c (2579): acquired connection pool slot=3D0 [Thu Oct 02 17:05:37 2008] [24767:0] [debug] ajp_marshal_into_msgb::jk_ajp_common.c (553): ajp marshaling done [Thu Oct 02 17:05:37 2008] [24767:0] [debug] ajp_service::jk_ajp_common.c (2050): processing ajp13 with 2 retries [Thu Oct 02 17:05:37 2008] [24767:0] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (934): sending to ajp13 pos=3D4 len=3D411 max=3D8192 =20 Does anyone have any ideas? I tried increasing the Apache log level to debug, thinking it could be a mod_dir problem, but there was no additional logging output.=20 --------------------------------------------------------------------- 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