Question....

I have Apache setup as my webserver. Tomcat is hooked into Apache via mod_jk, so the user never interacts with Tomcat.

I have set up SSL on the Apache Webser...I can hit it with https:// localhost

When I try to access my application at ...https://localhost/app I get a directory not found error.

Catch is when I go regular http... I can hit it fine... http:// localhost/app

What do I have to edit for this connection to work?

  • I have uncommented the AJP connector in server.xml
  • I have added my virtual host to httpd.conf

What am I missing?

Thanks in advance.

Jared

link|improve this question
feedback

5 Answers

The http and https are considered different virtual servers by Apache. Did you set up your reverse proxy under both virtual hosts?

link|improve this answer
feedback

you need to replicate the setup you have from http to https - you don't need the ajp connector if you have a http connector

look how it is setup - probably it does a proxy pass or uses a RewriteRule with the P at the end which is a proxy.

link|improve this answer
feedback

Your definition for workers could be wrong. Check workers.properties for work's type. If ajp13, unconmment your ajp section in tomcat back as it was. mod_jk usually uses ajp13 as type.

link|improve this answer
feedback

It should work if configured correctly. Just another thing to check - that your proxy pass rules are accessible within the SSL connection. It is possible to configure the SSL version of a website to be different from the non-SSL version. Make sure that your proxy pass configuration is sitting in both.

link|improve this answer
feedback

If you use mod_jk, you need the AJP connector in Tomcat.

In most cases, if the worker has a configuration problem, Apache will answer with a 500 error (Server error). If you get a 404, this is rather because the request does not get passed to the Tomcat server (or the URL is invalid from Tomcat point of view). Check that the JkMount is present and correct in your Apache configuration (for the 443 port).

To debug problems with mod_jk, turn on the debug logs in mod_jk and look at Apache logs. Add these lines in mod_jk configuration (jk.conf in general):

JkLogFile /var/log/apache2/mod_jk.log

JkLogLevel debug

You should see some logs at startup and some interesting details for each request.

I did this kind of setup for Apache2 + SSL + JBoss. You will find other details and optimisation tips in Deploying a J2EE application behind an Apache server in a production environment

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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