wood burning stoves 2.0*
The moose likes Tomcat and the fly likes getting apache 2 to work with tomcat 4.1.27 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "getting apache 2 to work with tomcat 4.1.27" Watch "getting apache 2 to work with tomcat 4.1.27" New topic
Author

getting apache 2 to work with tomcat 4.1.27

John Kim
Greenhorn

Joined: Jun 16, 2003
Posts: 6
i've successfully installed apache 2 and tomcat 4.1.27 and have them running in one machine. basically i have apache handle the static pages, and tomcat handle the .jsp pages. so far, so good. but when i proceeded to do the same for another machine, i couldn't get it to work. i made sure that i replicated the same steps i did for the first machine, but i couldn't get it to work. the only difference would be the location of tomcat directory, but i've already checked all the paths and made the necessary changes in httpd.conf, workers.properties, and server.xml. eventually, i set the log option to -debug and tried to see what the difference in output was, and the following line was the only difference i could find.

machine a(works):
[Mon Sep 08 14:45:44 2003] [jk_ajp_common.c (1546)]: Into jk_worker_t::get_endpoint
[Mon Sep 08 14:45:44 2003] [jk_ajp_common.c (1208)]: Into jk_endpoint_t::service
[Mon Sep 08 14:45:44 2003] [jk_ajp_common.c (295)]: Into ajp_marshal_into_msgb
[Mon Sep 08 14:45:44 2003] [jk_ajp_common.c (463)]: ajp_marshal_into_msgb - Done
[Mon Sep 08 14:45:44 2003] [jk_connect.c (177)]: Into jk_open_socket
[Mon Sep 08 14:45:44 2003] [jk_connect.c (184)]: jk_open_socket, try to connect socket = 10
[Mon Sep 08 14:45:44 2003] [jk_connect.c (193)]: jk_open_socket, after connect ret = 0
[Mon Sep 08 14:45:44 2003] [jk_connect.c (202)]: jk_open_socket, set TCP_NODELAY to on
[Mon Sep 08 14:45:44 2003] [jk_connect.c (219)]: jk_open_socket, return, sd = 10
[Mon Sep 08 14:45:44 2003] [jk_ajp_common.c (661)]: In jk_endpoint_t::ajp_connect_to_endpoint, connected sd = 10
[Mon Sep 08 14:45:44 2003] [jk_ajp_common.c (693)]: sending to ajp13 #389
[Mon Sep 08 14:45:44 2003] [jk_ajp_common.c (966)]: ajp_send_request 2: request body to send 0 - request body to resend 0
[Mon Sep 08 14:45:44 2003] [jk_ajp_common.c (804)]: received from ajp13 #189
[Mon Sep 08 14:45:44 2003] [jk_ajp_common.c (515)]: ajp_unmarshal_response: status = 302
[Mon Sep 08 14:45:44 2003] [jk_ajp_common.c (521)]: ajp_unmarshal_response: Number of headers is = 4
[Mon Sep 08 14:45:44 2003] [jk_ajp_common.c (575)]: ajp_unmarshal_response: Header[0] [Set-Cookie] = [JSESSIONID=F45D40F443D571DAC4C6519956C647CA; Path=/]
[Mon Sep 08 14:45:44 2003] [jk_ajp_common.c (575)]: ajp_unmarshal_response: Header[1] [Location] = [http://lnx5/cellbackup/index.html]
[Mon Sep 08 14:45:44 2003] [jk_ajp_common.c (575)]: ajp_unmarshal_response: Header[2] [Content-Type] = [text/html;charset=ISO-8859-1]
[Mon Sep 08 14:45:44 2003] [jk_ajp_common.c (575)]: ajp_unmarshal_response: Header[3] [Content-Length] = [0]
[Mon Sep 08 14:45:44 2003] [jk_ajp_common.c (804)]: received from ajp13 #2
[Mon Sep 08 14:45:44 2003] [jk_ajp_common.c (1521)]: Into jk_endpoint_t: one, recycling connection
[Mon Sep 08 14:45:44 2003] [jk_uri_worker_map.c (486)]: Into jk_uri_worker_map_t::map_uri_to_worker
[Mon Sep 08 14:45:44 2003] [jk_uri_worker_map.c (502)]: Attempting to map URI '/myapp/index.html'
[Mon Sep 08 14:45:44 2003] [jk_uri_worker_map.c (624)]: jk_uri_worker_map_t::map_uri_to_worker, done without a match
[Mon Sep 08 14:45:44 2003] [mod_jk.c (2287)]: mod_jk::jk_translate, check alias_dir: /usr/tomcat/webapps
[Mon Sep 08 14:45:44 2003] [mod_jk.c (2311)]: mod_jk::jk_translate, AutoAlias child_dir: index.html
[Mon Sep 08 14:45:44 2003] [mod_jk.c (2337)]: mod_jk::jk_translate, AutoAlias OK for file: /usr/tomcat/webapps/myapp/index.html

machine b (doesn't work):
[Mon Sep 08 15: 05:52 2003] [jk_ajp_common.c (1546)]: Into jk_worker_t::get_endpoint
[Mon Sep 08 15: 05:52 2003] [jk_ajp_common.c (1208)]: Into jk_endpoint_t::service
[Mon Sep 08 15: 05:52 2003] [jk_ajp_common.c (295)]: Into ajp_marshal_into_msgb
[Mon Sep 08 15: 05:52 2003] [jk_ajp_common.c (463)]: ajp_marshal_into_msgb - Done
[Mon Sep 08 15: 05:52 2003] [jk_connect.c (177)]: Into jk_open_socket
[Mon Sep 08 15: 05:52 2003] [jk_connect.c (184)]: jk_open_socket, try to connect socket = 10
[Mon Sep 08 15: 05:52 2003] [jk_connect.c (193)]: jk_open_socket, after connect ret = 0
[Mon Sep 08 15: 05:52 2003] [jk_connect.c (202)]: jk_open_socket, set TCP_NODELAY to on
[Mon Sep 08 15: 05:52 2003] [jk_connect.c (219)]: jk_open_socket, return, sd = 10
[Mon Sep 08 15: 05:52 2003] [jk_ajp_common.c (661)]: In jk_endpoint_t::ajp_connect_to_endpoint, connected sd = 10
[Mon Sep 08 15: 05:52 2003] [jk_ajp_common.c (693)]: sending to ajp13 #411
[Mon Sep 08 15: 05:52 2003] [jk_ajp_common.c (966)]: ajp_send_request 2: request body to send 0 - request body to resend 0
[Mon Sep 08 15: 05:52 2003] [jk_ajp_common.c (804)]: received from ajp13 #221
[Mon Sep 08 15: 05:52 2003] [jk_ajp_common.c (515)]: ajp_unmarshal_response: status = 302
[Mon Sep 08 15: 05:52 2003] [jk_ajp_common.c (521)]: ajp_unmarshal_response: Number of headers is = 4
[Mon Sep 08 15: 05:52 2003] [jk_ajp_common.c (575)]: ajp_unmarshal_response: Header[0] [Set-Cookie] = [JSESSIONID=94805B09E72C4E81CA5B3F28BA7D709F.tomcat1;\
Path=/]
[Mon Sep 08 15: 05:52 2003] [jk_ajp_common.c (575)]: ajp_unmarshal_response: Header[1] [Location] = [http://cellbackup1/cellbackup/index.html]
[Mon Sep 08 15: 05:52 2003] [jk_ajp_common.c (575)]: ajp_unmarshal_response: Header[2] [Content-Type] = [text/html;charset=ISO-8859-1]
[Mon Sep 08 15: 05:52 2003] [jk_ajp_common.c (575)]: ajp_unmarshal_response: Header[3] [Content-Length] = [0]
[Mon Sep 08 15: 05:52 2003] [jk_ajp_common.c (804)]: received from ajp13 #2
[Mon Sep 08 15: 05:52 2003] [jk_ajp_common.c (1521)]: Into jk_endpoint_t: one, recycling connection
[Mon Sep 08 15: 05:52 2003] [jk_uri_worker_map.c (486)]: Into jk_uri_worker_map_t::map_uri_to_worker
[Mon Sep 08 15: 05:52 2003] [jk_uri_worker_map.c (502)]: Attempting to map URI '/myapp/index.html'
[Mon Sep 08 15: 05:52 2003] [jk_uri_worker_map.c (624)]: jk_uri_worker_map_t::map_uri_to_worker, done without a match
[Mon Sep 08 15: 05:52 2003] [mod_jk.c (2287)]: mod_jk::jk_translate, check alias_dir: /home/cellbackup/tomcat/webapps
[Mon Sep 08 15: 05:52 2003] [mod_jk.c (2311)]: mod_jk::jk_translate, AutoAlias child_dir: index.html

so the only line missing from the second machine's log is
[Mon Sep 08 14:45:44 2003] [mod_jk.c (2337)]: mod_jk::jk_translate, AutoAlias OK for file: /usr/tomcat/webapps/myapp/index.html
obivously something's not getting done right, but i just can't seem to figure out what exactly is the cause.. i've been working on this all day and i'm about ready to give up.. also for your reference, here's a snippet of httpd.conf where i set the alias. any help would be greatly appreciated, thanks in advance.
LoadModule jk_module modules/mod_jk.so
#
# Configure mod_jk
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H: %M:%S %Y] "
JkAutoAlias /usr/tomcat/webapps
JkMount /*.jsp tomcat1
JkMount /*/servlet/ tomcat1
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

One comment I'd have about the mappings is:
JkMount /*.jsp tomcat1
JkMount /*/servlet/ tomcat1
s/b
JkMount /*.jsp tomcat1
JkMount /servlet/* tomcat1
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getting apache 2 to work with tomcat 4.1.27