Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This will make the tomcat user owner for all files allowing for read/write access - otherwise the server will not start because it cannot log or read certain files.


Enable HTTPS:
This configuration will guide you through the configuration of HTTPS on tomcat. These steps will create an individual keystore containing a single key that will be used by tomcat to create the secure connections.

The first step is to create the keystore:

$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA -keystore $CATALINA_HOME/conf/keystore

'tomcat' parameter specifies the name of the key we want to include in the keystore. Once this command is executed, the system will ask for some information regarding the keystore such as password (for the keystore and the key) and information about the Organization behind the keystore. 

The result of this command is a keystore file created in $CATALINA_HOME/conf/keystore

The next step is to edit $CATALINA_HOME/conf/server.xml to configure and enable the HTTPS connector.  Inside this file locate the following connector: 

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

By default, the connector is not enabled (it is commented in the xml file). You need to enable it (uncomment it) and configure it in order to use the created keystore:

 

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="$CATALINA_HOME/conf/kestore" keystorePass="changeme"/>

Make sure to use the same password you used when you created the keystore.

Restart tomcat and try to access it through HTTPS: http://localhost:8443/

Remember - have fun!