Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Tomcat and Apache web server. by MOD_JK I configure Apache to send request for to Tomcat. works correctly and Tomcat response to it.
now I want this to work, (SSL).
I search it and found that I need Virtualhost on Apache that send requests to Tomcat, my question is how can I create a SSL Virtualhost?
and should I remove all configuration that I create before this for

share|improve this question
up vote 1 down vote accepted

One vhost entry will reference :80 and the other :443

So for example (stripped down version) This assumes you never want to login with non-ssl.. So redirect to ssl

NameVirtualHost *:80
NameVirtualHost *:443

<VirtualHost *:80>
    Redirect /


<VirtualHost *:443>

    SSLEngine on
    SSLCertificateFile /etc/httpd/conf/
    SSLCertificateKeyFile /etc/httpd/conf/

    ProxyPass /
    ProxyPassReverse /


That also assumes tomcat has the ip of and running on port 8080

share|improve this answer
why you don't use mod_jk? it's not useful for this issue? – Mohammad Ali Akbari Jan 18 '11 at 15:54
I don't want mod_jk running on the same web nodes that do php – Mike Jan 18 '11 at 18:58
what is wrong? I get this error from Mozilla Firefox "the page isn't redirecting properly", it's because loop in redirection, how can I solve it? – Mohammad Ali Akbari Jan 19 '11 at 11:56

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.