I need to implement the following scenario:

  • 02 different web servers (1 Tomcat and 1 Apache)
  • Tomcat has SSL and was configured to restrict access to clients that do not have the appropriate certificate
  • Apache need to access the tomcat's application

How can I configure apache with appropriate certificate to gain access in Tomcat?


  • When you say "Apache needs access to tomcat's application" what exactly do you mean? Do you want to serve the same application through apache? Or do you need some kind of CGI running in the apache server to be able to do some kind of web service call to Tomcat in order to assemble a response for users? – Bart B Jul 20 '12 at 15:28
  • They are differente applications, one is based in php (apache) and the other is based in java (tomcat) and I need to ensure the communication between them (with SSL). In my scenario I already have Tomcat SSL with self signed certificate and restrict access (it works perfectly if I install the certificate on the client computer). But, if I install the same certificate in Apache Server and try to access java app through Apache, does not work. Do I need say something in Apache Conf to use the certificate? Or there are another way to ensure this communication? Thanks. – deschamps Jul 20 '12 at 17:31
  • That doesn't actually answer my question directly, but I THINK you are saying that the PHP app needs to query the Tomcat app for information over HTTPS, so I guess that means PHP is reading XML or JSON or something over a web connection? – Bart B Jul 23 '12 at 13:27
  • Bart B my php application calls RESTful and read XML – deschamps Apr 29 '13 at 18:21

It is not clear whether or not you are using mod_proxy or if your PHP application is making the SSL connection directly.

If you are using mod_proxy then you need to use the following directives in your Apache http config, most likely in the appropriate Location block:

SSLProxyCACertificateFile /path/to/ca.pem 
SSLProxyMachineCertificateFile /path/to/client.pem

Normally ca.pem contains the certificates of the CAs you trust to sign server certificate but since you are using a self-signed certificate ca.pem will contain the self-signed certificate.

The client.pem file contains the client key and certificate in PEM format (BEGIN CERTIFICATE ... END CERTIFICATE) concatenated together, with the key first.

If you are making the SSL connection directly from your PHP code then Apache httpd is not directly involved and just runs your PHP script.

  • Actually, there are two applications (apache without any SSL and Tomcat with SSL selfsigned). I want to tell to apache use the right certificate to gain access on Tomcat. Is it possible? – deschamps Jul 23 '12 at 12:06

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.