Reputation: 727
I have got a SSL certificate for domain "www.example.com" and I have installed this certificate in tomcat server which runs on port 80 which runs fine. Now my requirement is to run php code in https since my Apache is running on 8080 how do I make https:// work on port 8080. Is it even possible? I tried installing same certificate in Apache (Editing SSL.conf file to point to my certificate.). I even converted tomcat keystore to apache key file. But I think I need mod_ssl which is not installed in my server and I am not even able to install it (Reconfigure Apache with mod_ssl).
To summarize my questions :
My basic requirement is to run both PHP and JSP codes through https.
Upvotes: 1
Views: 7093
Reputation: 1
just follow the steps, it is pretty easy :) https://www.digitalocean.com/community/articles/how-to-create-a-ssl-certificate-on-nginx-for-ubuntu-12-04
Upvotes: 0
Reputation: 6532
The simpler way to do this is to use Apache as the front-end, and use its ProxyPass capabilities (the opposite of your setup).
Have Apache run on port 80 and 443 (SSL), and Proxy requests for specific websites and/or URLs to Tomcat running on 127.0.0.1:8080.
It's simpler because to set this up in Apache, all you need is to add one line...
ProxyPass /foo http://127.0.0.1:8080/foo
So when a request comes in for https://www.example.com/foo, Apache get's /foo from Tomcat, and transparently passes back to you... And everything is SSLed as far as the user is concerned.
If you don't want to do this...
1) Is it possible to install SSL certificate on server running on port 8080.
Yes. Port numbers are not hardcoded to anything. Just enable SSL in that Tomcat Connector.
2) Is it possible to use same certificate generated from tomcat keystore in Apache.
It should be. Certificates are domain-based. They don't care about what type of server uses them... BUT they do need to be in the right format. You might need to re-format the key and cert.
Upvotes: 4