April 5, 2012

Apache Tomcat Installation and SSL Configuration

You can see/download latest versions of tomcat from the url: http://tomcat.apache.org/whichversion.html

To download and install Apache Tomcat version 7.0.26

cd /opt
wget http://apache.petsads.us/tomcat/tomcat-7/v7.0.26/bin/apache-tomcat-7.0.26.tar.gz
tar -xvf apache-tomcat-7.0.26.tar.gz /opt

Now set variables in server.

vi /root/.bashrc

Copy and paste below lines:

> export CATALINA_HOME=/opt/apache-tomcat-7.0.26

> export TOMCAT_HOME=$CATALINA_HOME

> export PATH=$CATALINA_HOME/bin:$PATH

Logout and Login to server.

**Configure SSL for tomcat**

Use below command to create the keystore and while creating use hostname for "first and last name"

keytool -genkey -alias tomcat -keyalg RSA -keystore /opt/keystore

Edit server.xml file and uncommented/edited these lines:



Note: change password as while you are creating the keystore

Restart tomcat

catalina.sh stop
catalina.sh start

No comments:

Post a Comment