Apache Tomcat Setup and SSL Configuration

OS: RHEL 6
Tomcat Version: 8.5

1. Set the environment

export JAVA_HOME=/u01/tmctv8/jdk/1.8.0_202
export CATALINA_HOME=/u01/tmctv8/tomcat8
export CATALINA_BASE=$CATALINA_HOME
export PATH=$JAVA_HOME/bin:$CATALINA_HOME/bin:$PATH

2. Edit the admin and roles credentials in tomcat-users.xml
$ vi /u01/tmctv8/tomcat8/conf/tomcat-users.xml
   <role rolename="manager-gui"/>
  <role rolename="admin-gui"/>
  <user username="admin" password="PASSWORD" roles="manager-gui,admin-gui"/>


3. Comment out the highlighted entries that is restricting access only localhost:
$ vi $CATALINA_HOME/webapps/host-manager/META-INF/context.xml
$ vi $CATALINA_HOME/webapps/manager/META-INF/context.xml

  <Valve className="org.apache.catalina.valves.RemoteAddrValve"

         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />

4. Edit SSL configuration in server.xml
Note: Request the ssl certificate in PKCS12 format and keystore password from the Certificate Authority (CA)
$ vi /u01/tmctv8/tomcat8/conf/server.xml
<Connector port="8445" protocol="HTTP/1.1" maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
keystoreFile="/u01/tmctv8/tomcat8/tomct_ssl/apache_ssl.pfx" keystorePass="" clientAuth="false" sslProtocol="TLS" keystoreType="PKCS12">

5. Restart the Apache Services:
$ ./shutdown.sh
$ ./startup.sh

6. Verify the Apache WebPage:
https://test.domain.com:8445



No comments:

Post a Comment