A Technology Blog About Code Development, Architecture, Operating System, Hardware, Tips and Tutorials for Developers.

Saturday, July 17, 2010

TOMCAT SSL CONFIGURATION IN UBUNTU

11:12:00 PM Posted by Satish Kumar , , , , No comments

This post is made considering the the system is having jdk 6 and Tomcat 6 installed and "JAVA_HOME" environment variable is set.

Bellow are the steps to configure tomcat to listen https port (8443)

1. Create a certificate keystore by executing the following command. It will ask few questions. It will also ask one password to enter. You have to remember this password as you need to specify that to configuration file.  You can store the keystore any where.
    keytool -genkey -alias tomcat -keyalg RSA 
    \-keystore /usr/local/tomcat/conf/.keystore

2. Now configure "tomcat_home"\conf\server.xml, add the following code.
    <Connector
    port="8443" 
    protocol="org.apache.coyote.http11.Http11Protocol"   
    maxThreads="200"
    scheme="https" secure="true" SSLEnabled="true"
    keystoreFile="/usr/local/tomcat/conf/.keystore"  
    keystorePass="password"
    clientAuth="false" 
    sslProtocol="TLS"/>  

You are done with your configuration. Save the "server.xml" file. Restart your tomcat. Now type https://localhost:8443

This should show you the same tomcat homepage but in secured format.

0 comments:

Post a Comment