1
votes

I have read many of the previous post regarding this on stack overflow and I still can't figure this out.

I installed Tomcat 7.0 on Windows 7, with an installer, and would like to change port 8443

to 443, but before doing that I understood from my previous question on this forum that I

need to set up a certificate to get port 8443 working before thinking of changing it to

port 443.

This step by step guide http://www.mulesoft.com/tomcat-ssl should be adequate but I am

really confused about this %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA do I

need to type this into "cmd" when I did it says "the system cannot find the path", so I

tried with

%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA \ -keystore /path/to/my/keystore(Windows)

%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA \ -keystore /Program Files/Apache Software Foundation/Tomcat 7.0/conf

Still no luck.

I have java 1.7 64bit on my PC

This is really my first time configuring Tomcat, thanks for understanding

1
Do you have the error message from the keytool commands?Chris White
yes I did. "keytool not recognised". I finally watched a youtube video about this and entered the comand properly from where my java was stored <where my java is stored>\keytool -genkey -alias tomcat -keyalg RSA \ -keystore <where I wish to store the cert> and it allowed me to create one :)victoria277
Ok, so post your own answer and accept it (so other people don't see this an an unanswered question)Chris White
Apparently I can't accept my own answer, if you don't mind, maybe you can :) thanks.victoria277
Your problem doesn't seem to be so much with keytool but in understanding what the notation in the documents you've read (especially with cmd). %JAVA_HOME% (equiv. to $JAVA_HOME on Unix) is an abstraction for the JRE home directory which you could set up as an environment variable or type in yourself. Path on the Windows command line tend to use back-slashes (\ ), not slashes (/).Bruno

1 Answers

1
votes

This answer provided is one in the many questions that might arise when configuring Tomcat 7's server.xml file.

The answer is specific to using Windows 7, JDK 1.7, 64bit

In order to successfully generate a Keystore find the path to your JDK's keytool this is found in your Java's bin folder, get to that point through the terminal, and then type in

\keytool -genkey -alias -keyalg RSA -keystore C:\MyCert.cert

C:\MyCert.cert is an example you may wish to store your certificate else where in your hard

hit enter and proceed