Subhasish Dash Subhasish Dash - 3 years ago 228
Apache Configuration Question

how to run tomcat in https and port 80?

I am trying to host a website on Centos + tomcat7 , if I run tomcat7 on port 80 everything works fine i.e. but if I want to access it using ,it doesn't work , but If I try like this after adding the keystore , then it works fine.

So, I need a way to run tomcat on 80 and https , i.e. should work fine on port 80.
Now,I am trying only with Tomcat but if it's totally not possible then I can use some Apache http server to redirect to tomcat using AJP connectors but that is the last thing I would prefer to do .
Also, can we do something with the IPTables?

Answer Source

You need to change the Connector port for https from the default value of "8443" to "443" in server.xml

The default looks something like this:

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
           maxThreads="150" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS" />

See SSL/TLS Configuration HOW-TO from the Tomcat docs on how to setup SSL

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download