System: Solaris SunOS 5.9
Apache: 2.0.52
Tomcat: 4.1.31
Mod JK: 1.2.6
The problem: Apache/mod_jk cannot resolve servlet URL mappings
When Tomcat is running stand-alone, it can resolve servlet mappings without
any problems; so that a page with this form definition:
<FORM name="login" method="POST" action="loginhandler">
correctly invokes the com.company.LoginHandler servlet (which suggests
there's nothing syntactically wrong with the <servlet> and
<servlet-mapping> entries in web.xml);
When Tomcat stand-alone is turned off and Apache is turned on, that same
page always throws a 404 error for "site/loginhandler"; these are the error
messages in mod_jk.log:
[Wed Jun 22 09:04:08 2005] [mod_jk.c (2313)]: mod_jk::jk_translate, check
alias_dir: /usr/apache/tomcat/webapps
[Wed Jun 22 09:04:08 2005] [mod_jk.c (2337)]: mod_jk::jk_translate,
AutoAlias child_dir: loginhandler
[Wed Jun 22 09:04:08 2005] [mod_jk.c (2363)]: mod_jk::jk_translate,
AutoAlias OK for file: /usr/apache/tomcat/webapps/aiwosc/loginhandler
[Wed Jun 22 09:04:08 2005] [jk_uri_worker_map.c (445)]: Into
jk_uri_worker_map_t::map_uri_to_worker
[Wed Jun 22 09:04:08 2005] [jk_uri_worker_map.c (459)]: Attempting to map
URI '/aiwosc/loginhandler'
[Wed Jun 22 09:04:08 2005] [jk_uri_worker_map.c (577)]:
jk_uri_worker_map_t::map_uri_to_worker, done without a match
What terribly simple configuration error have I made here?
These are the web.xml entries for this servlet:
<servlet>
<servlet-name>loginhandler</servlet-name>
<servlet-class>com.company.aiwosc.LoginHandler</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>loginhandler</servlet-name>
<url-pattern>/loginhandler</url-pattern>
</servlet-mapping>
This is the workers.properties file:
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=server.org
worker.ajp13.type=ajp13
This is the app section from mod_jk.conf:
#################### server.org:/aiwosc ####################
# Static files
Alias /aiwosc "/var/apache/tomcat/webapps/aiwosc"
<Directory "/var/apache/tomcat/webapps/aiwosc">
Options Indexes FollowSymLinks
DirectoryIndex index.html
</Directory>
# Deny direct access to WEB-INF and META-INF
#
<Location "/aiwosc/WEB-INF/*">
AllowOverride None
deny from all
</Location>
<Location "/aiwosc/META-INF/*">
AllowOverride None
deny from all
</Location>
JkMount /aiwosc/addtitleservlet ajp13
JkMount /aiwosc/submittitleservlet ajp13
JkMount /aiwosc/transfertitleservlet ajp13
JkMount /aiwosc/saveoscservlet ajp13
JkMount /aiwosc/reordercastservlet ajp13
JkMount /aiwosc/loginhandler ajp13
JkMount /aiwosc/editcategoryservlet ajp13
JkMount /aiwosc/edittitleservlet ajp13
JkMount /aiwosc/addaddendumservlet ajp13
JkMount /aiwosc/*.jsp ajp13
JkMount /aiwosc/addcategoryservlet ajp13
This is the <Context> entry for the app in server.xml:
<!-- Oscars OSC Context -->
<Context path="/aiwosc" docBase="aiwosc" debug="5"
reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="aiwosc_log." suffix=".txt"
timestamp="true"/>
<Resource name="jdbc/oscars" auth="Container"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/oscars">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@gtsora2.gtsgraphics.com:1521:ACAD</value>
</parameter>
<parameter>
<name>username</name>
<value>IMPC_ADMIN</value>
</parameter>
<parameter>
<name>password</name>
<value>PIRANHA</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>20</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>10</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>-1</value>
</parameter>
</ResourceParams>
</Context>
And these are the mod_jk load/configuration entries from httpd.conf:
<IfModule !mod_jk.c>
LoadModule jk_module modules/mod_jk.so
</IfModule>
Include /usr/apache/tomcat/conf/auto/mod_jk.conf
JkWorkersFile /usr/apache/tomcat/conf/workers.properties
JkLogFile /usr/apache/logs/mod_jk.log
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
JkAutoAlias /usr/apache/tomcat/webapps
JkMount /*.jsp ajp13
JkMount /*/servlet/ ajp13
--
David Rickard
Software Engineer
TechBooks/GTS
Your Single Source Solution!
Los Angeles CA * York, PA * Boston,MA * New Delhi, India
Visit us on the World Wide Web
<http://www.techbooks.com>http://www.techbooks.com
[EMAIL PROTECTED]
5650 Jillson St., Los Angeles, CA 90040
(323) 888-8889 x331
(323) 888-1849 (Fax)