Simple guide to setup SSL in Tomcat

Author posted by Jitendra on Posted on under category Categories JAVA, JSP, Servlet and tagged as Tags , , with 1 Comment on Simple guide to setup SSL in Tomcat

I have enabled SSL in tomcat many times however initially I struggled to get it in running condition. So I thought to share a simple approach I am following now days.

Step 1:

Run tool “Keytool“ provided by the JRE to create a “keystore file”.
The command to run tool is:

keytool -genkey -alias tomcat -keyalg RSA -keystore D:/.keyStore

Where “D:/.keystore” is the path where file should be created.
Instead of alias “tomcat” any other name can be used.
After running above command, you will be asked many questions, so answer them correctly as shown in below image:

Tomcat SSL keytool to create keystore file
Tomcat SSL keytool to create keystore file

Remember the password provided, as it will be needed in next step. Continue reading “Simple guide to setup SSL in Tomcat”

How to start the tomcat in debug mode for debugging in eclipse

Author posted by Jitendra on Posted on under category Categories JAVA and tagged as Tags , with 2 Comments on How to start the tomcat in debug mode for debugging in eclipse

This is the tutorial on How to start the tomcat in debug mode for debugging in eclipse

1. Open the startup script in (your_tomcat_home) {Location is : %CATALINA_HOME%binstartup.bat }
2. Add the following lines at the first blank line in the file ( around line 8 )
Windows :

set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket

Linux:

export JPDA_ADDRESS=8000
export JPDA_TRANSPORT=dt_socket

3. Change the execute line at the end to include “jpda”
Window:

call “%EXECUTABLE%” jpda start %CMD_LINE_ARGS%

Linux:

exec “$PRGDIR”/”$EXECUTABLE” jpda start “$@”