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 am so close to completing my first custom install that I can 'taste it' ... I am following Apache Tomcat install and I have both servers working side-by-side. My Apache server is configured to the public IP and delivers HTML and XML pages to the internet.

My Tomcat, works with localhost:8080 and I can execute sample JSP, Servlets, Applets, etc.

Now I am interconnecting so Tomcat can service JSP and back-end DB to Apache requests. I found the Tomcat connector and I can verify from the logs that the URL is coming in from the internet, as it gets logged in the Apache log, then gets sent over to Tomcat as I can see the URL in its logs and parsed out components. So far, so good ... what isn't happening is the return trip -- the response.

The browser now gets a 503 Service Not Available response (huge progress/success) and I can see the ascii/hex response dumped in the logs.

I think the missing piece is getting the rules configured into the server configuration. That is where the install doc got very vague. I have surfed for the answer, but it is all coming back as IIS answers which does not apply to my Apache.

I think the rules are correct, but I need to know how to, "put them in the server configuration." I assume the file goes on the conf/ folder where my workers.properties is stored and I am guessing that the reference goes in 'server.xml' -- are those two points correct?? And what section of server.xml does it go in and how is the config-node formatted?

If my question needs more detail, please fire-back and I will provide more.

  • Apache 2.2
  • Windows XP 5.1.26 (ancient but all the SPs are installed)
  • Tomcat 5.2.7
  • Java / JRE / JSDK, etc are all ~1.4.x, 1.5.x and 1.6.x (I would have to dig more for this if needed).
  • Connector is 1.7 (I think) is configured for AJP1.3
  • All standard ports
  • Firewall is Netgear with port forwarding
  • User-id / Passwords are not default
  • Other stuff ????

Also, if there are any more hints on debugging/tracing out this issue - I would like to get that documented for my client.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Badly Badly misread the title of the question - Long day. The command directive you are looking for is this:

JkMountFile

You would put this directive in your httpd.conf (or a seperate mod_jk.conf depending on how you are setup)

From the documentation for apache

File containing multiple mappings from a context to a Tomcat worker. It is usually called uriworkermap.properties. For inheritance rules, see: JkMountCopy. There is no default value.


I'll leave this here in case anyone is interested.

So, since you have a workers.properties you are probably using mod_jk (which has been depreciated for mod_proxy_ajp*). workers.properties are actually part of the mod_jk configuration.

Yes, the documentation for mod_jk is pretty light. So I'll just go ahead and show you my production configuration as an example - you might have to modify it slightly as we run *nix boxes but the concepts are the same.

  1. You httpd.conf should have something similar to this: This tells apache to include a seperate mod_jk configuration file (you can actually put those directives right in the httpd.conf but... i like modularity). Then configure the alias, and the mount point for your jsp files.

    Include <path_to_mod_jk.conf>
    <VirtualHost *:80>
    JkAutoAlias /usr/tomcat/webapps
    JkMount /<your_webapp>/*.jsp <your_worker>
    
  2. Your mod_jk.conf should look something like this:

This is where you set all of your generic mod_jk setting for apache, logs, workers file, etc.

    #MOD_JK Config File
    JkWorkersFile <path_to_your_workers.properties>
    JkLogFile /var/log/httpd/mod_jk.log
    JkLogLevel error
    JkShmFile /var/run/mod_jk.shm

3. And finally you should have a workers.properties similar to: Finally we get to the meat of the config. This is where you setup the worker. the options are pretty self explanatory.

    worker.<your_worker_name>.type=ajp13
    worker.list=<your_worker_name>
    #Worker Config
    worker.<your_worker_name>.host=127.0.0.1
    worker.<your_worker_name>.port=8009
  • And yes, i still run this in production although we are starting a modernization project that will probably see the end of mod_jk and a migration to mod_proxy_ajp
share|improve this answer
    
Hey Zypher! Thanks for the super quick response and the awesome detail. That really puts the "dots on the i's and crosses on the t's" for my understanding. My intellectual problem is the one stated, but the missing technical piece was that I put my JSP files in the Apache space (htdocs/) not Tomcat's space (webapp/). My rules were a bit tweeked and my server config was 'ok' upon further review -- then it hit me like a baseball in the face ... wrong location of the JSP. It is working --this is a major milestone for me. Again - thanks we can celebrate together (I gave you the answer star). –  mobibob Jan 7 '10 at 3:23
    
Happens the the best of us :) Good luck! –  Zypher Jan 7 '10 at 3:44
add comment

Your Answer

 
discard

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.