Alfred’s Computing Weblog

Alfred Java-cored Computing Weblog

Posts Tagged ‘tomcat

SSL ya Tomcat

leave a comment »

Steps to enable SSL for your tomcat

1. Generate SSL key for your computer.

$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA -keystore /path/to/my/keystore

Reminder: check ../tomcat/conf/tomcat-user.xml for tomcat user’s password

2. Edit server.xml
– Open ../tomcat/conf/server.xml
– Uncomment following lines and add in “keystoreFile” and “keystorePass”

 <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               keystoreFile="/path/to/my/keystore" keystorePass="password"
               clientAuth="false" sslProtocol="TLS" />

3. You are DONE. You can try to access HTTPS with Port 8443 now.
Eg: https://www.example.com/SecretResource/1234567

Reference: Tomcat 6.0 SSL Configuration, here.

My environment:
Apache Tomcat v6.0.32
Sun Java v1.6.0_21
Red Hat 4.1.2-50

Advertisements

Written by Alfred

July 25, 2011 at 14:20

Posted in tomcat

Tagged with ,

Remote Debug Tomcat in Eclipse

leave a comment »

Remote debugging is a must for web-applications. When a .war file is deployed in a web/jee container, we have no way to track where / how the application runs besides doing on screen (or file) prompts. But this is not an effective way; and REMOTE DEBUGGING is the key to overcome this mountain.

To do remote debug of tomcat via Eclipse, is simple and effective. You just have to takes some times to setting up your environment once, and you can benefits from it in later days.

Step 1: Edit catalina.out / catalina.sh
Add in the string in the catalina.out
set JPDA_TRANSPORT=dt_socket
set JPDA_ADDRESS=8787

This action is to add port in your tomcat when it starts, and the port number defined here is “8787” (This is the default debug port for tomcat)

Step 2: Add “Remote Java Application” in Eclipse’s Debug

Remember to set the port number as the 1 you set in Step#1 and hits “Debug” button
p/s: pls set your break-points before you do this remote debug configuration

Step 3: Starts Tomcat
Go to "../tomcat/bin", hits “cataline.out jdpa start
Yeah, the remote debug is started, you can see your bug clearly now!

Source: Tomcat FAQ

Written by Alfred

April 24, 2008 at 15:45

Posted in Eclipse, Java, tomcat

Tagged with , ,