1

I am trying to learn how apache and tomcat and war files work

I have downloaded The Turnkey Tomcat on Apache VM and am running it in Parallels

http://www.turnkeylinux.org/tomcat-apache

I have downloaded a sample WAR file

http://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/

I then upload the sample.war file in the Tomcat Manager Application

WAR deploy screenshot

But when I browse to "http://[ip-address-of-vm]/sample" i get Not Found

Not Found screenshot

  • show logs: apache and catalina – Ilja Feb 6 '14 at 20:49
2

You probably need to add a JkMount directive to the Apache mod_jk configuration. Edit the file /etc/tomcat6/mod_jk.conf and add a line like this:

JkMount /sample* ajp13_worker

The mod_jk.conf file most likely already contains JkMount directives for the manager webapp and a few others. Make sure the name of the AJP worker (ajp13_worker in the example above) matches the one used in existing mappings.

Then restart the Apache Web server.

| improve this answer | |
  • This worked, why is this not done when I "deploy" the WAR? Is there a configuration to make that happen? When I go to the web root I am directed automatically to the /cp path, how is that? – Tyler Clendenin Feb 6 '14 at 21:53
  • 1
    It it not done automatically when you deploy the war because with this setup, Apache Web Server is listening on port 80 and all http requests go to it first. This config tells it to forward some of the requests to Tomcat. As for the root redirect, it is probably caused by a redirect rule in the Apache config. – David Levesque Feb 6 '14 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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