The Artima Developer Community
Sponsored Link

Java Answers Forum
Apache-Tomcat mod_jk servlet mapping issue

1 reply on 1 page. Most recent reply: Nov 6, 2002 8:42 PM by Jay Kandy

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Tricia Anderson

Posts: 1
Nickname: tbone993
Registered: Nov, 2002

Apache-Tomcat mod_jk servlet mapping issue Posted: Nov 6, 2002 9:50 AM
Reply to this message Reply
Advertisement
I am using an Apache Tomcat integration with MOD_JK.. Attached is the server.xml file and httpd.conf file. I at least want to get the HelloWorldExample servlet to work..but can not even get that..Please anyone help. My jsps are working fine. I have my physical web application seperate from the tomcat install..thus the virutal host mapping. My document root is: /home/httpd/cordimarian-as
Under that I have copied the /examples folder from the tomcat install but I can not get the HelloWorldExample to run.
the url I'm entering in is http://www.cordimarian-as.org/examples/servlet/HelloWorldExample
but i get the HTTP Status 404 - /examples/servlet/HelloWorldExample is not available.....

***can anyone tell me what I'm missing or what is out of WHACK?
Any info you can provide would be wonderful!!!
Thanks,
-T

--server.xml

<Host name="www.cordimarian-as.org" debug="0" appBase="/home/httpd/cordimarian-as" unpackWARs="true">
<Alias>www.cordimarian-as.org</Alias>
<Ali as>cordimarian-as.org</Alias>
<Alias>208.32.141.154</Alias>
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="cordimarian-as_access_log."
suffix=".txt" pattern="common" />
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="cordimarian-as1_log." suffix=".txt"
timestamp="true" />
<!-- Tomcat Root Context -->
<Context path="" docBase="/home/httpd/cordimarian-as"
debug="0" />
<!-- XML Schema Context -->
<Context path="/home/httpd/cordimarian-as" docBase="/home/httpd/cordimarian-as" debug="0" reloadable="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="cordimarian-as2_log." suffix=".txt" timestamp="true" />
</Context>
<!--Examples Context -->
<Context path="/examples" docBase="examples" debug="0"reloadable="true" crossContext="true"></Context>
</Host>


httpd.conf file is as follows:--

[...]

# Purpose: Integrate Tomcat v4.1.12 [jsp support] into Apache
LoadModule jk_module libexec/mod_jk.so
# commented, [warn] mod_jk.c is already added
# AddModule mod_jk.c
JKWorkersFile /var/tomcat4/conf/workers.properties
JkLogFile /usr/local/apache/logs/mod_jk.log
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /examples/servlet/* ajp13
JkMount /*/servlet/ ajp13

# Purpose: change root directory for apache and tomcat server
(.jsp support)
# to the same, to avoid conflicts and problems such as loading
an image file
DocumentRoot "/var/tomcat4/webapps/ROOT"

[...]

<VirtualHost www.cordimarian-as.org>
ServerAdmin webmaster@claret.org
DocumentRoot /home/httpd/cordimarian-as
ServerName www.cordimarian-as.org
ErrorLog /home/httpd/cordimarian-as/errlog
CustomLog /home/httpd/cordimarian-as/translog combined
ScriptAlias /cgi-bin/ /home/httpd/cordimarian-as/cgi-bin/
<Directory /home/httpd/cordimarian-as/stats>
AuthType Basic
AuthName "Usage Statistics"
AuthUserFile /usr/local/apache/secure/cordimarian-as_users
<Limit GET>
require valid-user
</Limit>
</Directory>
JkMount /*.jsp ajp13
JkMount /examples/servlet/* ajp13
JkMount /servlet/* ajp13
JkMount /*/servlet/* ajp13
</VirtualHost>


Jay Kandy

Posts: 77
Nickname: jay
Registered: Mar, 2002

Re: Apache-Tomcat mod_jk servlet mapping issue Posted: Nov 6, 2002 8:42 PM
Reply to this message Reply
Few things...
1. Can you run http://www.cordimarian-as.org:8080/examples/servlet/HelloWorldExample ? i.e, Does your servlet work without Apache. If not, that needs to be resolved first.

2. DocumentRoot is just where Apache serves static content from. Not very much related to Tomcat.

3. Edit your workers.properties file to make entries like this:

worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=aj p13


4. In your server.xml look for AjpConnectionHandler and see that you have the same port set as above (8009)

If this seems overwhelming, spend some time on a HOW-TO here: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/index.html

Flat View: This topic has 1 reply on 1 page
Topic: Help please Previous Topic   Next Topic Topic: Urgent-Where can i find the cookie generated by Domino Server

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use