Dibyendu Mitra Roy
Dibyendu Mitra Roy

Reputation: 1665

Trouble in accessing to Tomcat using Apache as a secure proxy

I have few web pages/services running on apache on server A. One of the web service needs to access an application running on another physical server B. This other server B has tomcat installed on it. On the server B I have disabled most ports except 8080 and 8443. To maintain the URL scheme, I make my Apache server act as a proxy for the tomcat server for that one service which needs to be processed on server B. Another point of note is that all web services are secured and must only be accessed via https. The cert files are correctly installed because I can access the other projects on my apache with https.

When I try to access the that one web service which is to be processed on server B, I am repeatedly getting 503 error - Service Temporarily Unavailable.

Here is my set up on both the servers:

On server A with Apache:

I have enabled following directives in my httpd.conf file making sure that the proxy is enabled:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

I also added the following 2 lines in httpd conf file

ProxyRequests Off
ProxyPreserveHost on

Next, I have the following lines in my ssl.conf

Listen 443
<VirtualHost _default_:443>
SSLEngine on
SSLProxyEngine on
SSLCertificateFile /etc/pki/tls/certs/your_company_certificate.pem
SSLCertificateKeyFile /etc/pki/tls/certs/your_company_private_key.pem
ServerName my_company_domain_name
ProxyPass /app http://tomcat_server_ip:8443/app
ProxyPassReverse /app http://tomcat_server_ip:8443/app
</VirtualHost>

Now in tomcat which is in a different server (B), I specified the following inside server.xml:

<Connector port="8080" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="true" redirectPort="443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true"/> 

 <Connector port="8443" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="true" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true"        
        scheme="https"
        secure="false" 
        SSLEnabled="true" 
        proxyPort="443"
        proxyName="my_company_domain_name"
     />

Testing Outcome:

The desired outcome should be that when I hit the this URL https://my_company_domain_name/app in my browser this should get redirected to http://tomcat_server_ip:8443/app

However, all it returns is Service Temporarily Unavailable

Upvotes: 1

Views: 959

Answers (1)

souser
souser

Reputation: 6120

Port 8443 is over https ; why are you referencing it over http ? You also need to first confirm that https://tomcat_server_ip:8443/app works correctly.

Upvotes: 3

Related Questions