0

I have an Ubuntu 11.10 with Apache2 that is hosting some sites. I would like to add a site that is hosted in tomcat, so I installed mod_jk and set it up. The tomcat site is hosted under /app over ajp13.

When I include the line

JkMount /app/* ajp13_worker

in inside of the <virtualhost> in either 000-default or default-ssl, it works perfect. However instead I would rather use the Ubuntu convention of putting new sites in a seperate file inside /etc/apache2/sites-enabled/. I have other sites inside of this path using <Location> directives.

However, when I put the above line in a file in this path, it does not work. I just get a 404 when trying to access the site. Also, when I instead use something like

<Location /app/*>
  JkMount ajp13_worker
</Location>

I still get a 404. Any ideas why the JkMount does no work outside of the even though other Locations do work like this?

  • Without more information about your config it is hard to tell. It sounds like you end up in the wrong virtualhost. Can you post your new config file containing the JkMount directive? – sborsky Dec 29 '11 at 12:15
0

So I ended up moving over from mod_jk to mod_proxy_ajp, which I should have done a long time ago. It is much easier to configure and works out of the box. When using mod_proxy_ajp, adding a tomcat site is as easy as putting a file insite my /sites-enabled/ containing:

<IfModule mod_proxy_ajp.c>
        ProxyPass /app ajp://127.0.0.1:8009/app
</IfModule>

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.