Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I just finished up configuring a fairly default configuration of Tomcat. My Apache configuration was pre-existing and post-tomcat it still has no issues. I am using mod_jk to (if I am saying this correctly) interface between Apache and Tomcat and have my conf files setup for my workers, etc.

I put my test file (Simply: http://tomcat.apache.org/tomcat-4.1-doc/appdev/sample/web/hello.jsp) into my tomcat/webapps/ directory and then call it via http://localhost/jsptest/hello.jsp. From here Apache returns a 502 Bad Gateway response.

I confirmed this via the Apache logs, but beyond that I have no idea how to diagnose the issue. I assume the 502 is because Tomcat did not respond. I'd like to confirm if Tomcat received the request, but cannot locate the log file.

At this point I had thought my installation was complete, so not sure where to go from here. Any input would be appreciated.

Edit: catalina.out, manager.log, localhost.log, etc do not have any data logged for the time that I made my requests.

Edit: Slowly figuring the configuration out. The following three lines appear in mod_jk.log when I make a request:

[Tue Jun 01 17:34:26 2010] [4207:3086195296] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (1252): wrong message format 0x3c21 from
[Tue Jun 01 17:34:26 2010] [4207:3086195296] [error] ajp_get_reply::jk_ajp_common.c (2055): (worker) Tomcat is down or refused connection. No response has been sent to the client (yet)
[Tue Jun 01 17:34:26 2010] [4207:3086195296] [error] ajp_service::jk_ajp_common.c (2559): (worker) connecting to tomcat failed.

Edit: Changed the port in workers.properties from 8080 to 8009. Now mod_jk.log shows the following:

[Tue Jun 01 17:54:55 2010] worker localhost 0.003423

So Tomcat is getting the request, however a 404 (from Tomcat) is returned even though I added hello.jsp to both my tomcat/webapps/ and apache/html/jsptest/ directories in order to cover all bases. Perhaps I am misunderstanding the Aliasing method? Not sure how it cannot find a file that exists in the two most logical places...

Edit: Well, I just walked myself straight through the problem. My port was wrong in workers.properties. Once I fixed that and saw the 404 from Tomcat I realized the configuration was working and the file couldn't be found. What I didn't realize was that the jsptest directory needed to be in tomcat/webapps/jsptest/. Now everything works... thanks for humoring me. Hopefully this helps someone.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Changed the port from default 8080 to 8009 and also added my jsptest directory to tomcat/webapps/ so that it worked according to the JkMount /jsptest/*.jsp worker directive.

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.