Pages

Thursday, May 2, 2013

Installation and Configuration of Tomcat 6

Installation and Configuration of Tomcat 6

Install Tomcat6

Login as root or sudo user, please install the tomcat 6 as follows.

yum install tomcat6

Generate the Self Signed Certificate

Go to the /etc/tomcat6 directory and run the following command to create the self signed certificate. Please make sure that open jdk installed and keytool in the path.

keytool -genkeypair -keystore sp.jks -alias tomcat

After entering the above command, it will ask the keystore password, First and Last Name is your machine name , and key pass. Please ignore remaining attribute.

Enable the SSL for tomcat6

Go to the /etc/tomcat6 directory and edit the server.xml and uncomment the Connector port 8443. After uncommented, the connector configuration as follows.

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS"
               keystoreFile="/etc/tomcat6/sp.jks" keystorePass="<Key Store Password>"
               />

I have highlighted in red colour to configure key store location and key store password.  


Deploy the Sample Web Application

I have developed the sample web application and it contains the header.jsp file and it will display all the headers from the request. This web application is deployed in the tomcat6. The deployment shown below.

Go to the /etc/tomcat6/Catalina/localhost/ directory and create the testapp.xml file and add the following content to deploy the testapp war file into the tomcat.

<Context docBase="/tmp/testapp.war"
        privileged="true"
        antiResourceLocking="false"
        antiJARLocking="false"
        unpackWAR="true"
        swallowOutput="true" />

Restart the Tomcat6

service tomcat6 restart

Log File Location

The tomcat6 log files are available in the /var/log/tomcat6/ directory.


No comments:

Post a Comment