Install Tomcat Linux
References:
- https://openjdk.org/install/
- https://www.digicert.com/kb/util/csr-creation-ssl-installation-tomcat.htm
Steps To Install Tomcat For Linux:
- Get apache-tomcat-9.0.73.tar.gz at https://tomcat.apache.org/download-90.cgi .
- Make sure you already installed OpenJDK. Refer https://muzakkirskills.blogspot.com/2023/01/install-openjdk-for-linux.html on how to install OpenJDK on Linux.
-
-
- Create a new user named tomcat.
- Make tomcat folder owned by tomcat user.
- Create a tomcat.service unit file under /etc/systemd/system/ .
-
- Reload the systemd configuration.
- Start the tomcat service, enable it to auto-start at system boot and check the status.
- Access tomcat web interface using browser . Use this link to open Tomcat page http://localhost:8080/ .
Steps To Enable HTTPS SSL on Tomcat:
- Stop Tomcat service.
- Go to your OpenJDK or JRE folder. Example like below.
- Generate a self signed certificate.
- Specify password. Please make sure that you remember your password or maybe you can keep it somewhere safe.
- Specify First and last Name. Put anything you want.
- Specify organizational unit, organization, City or Locality, State or Province, and country code. If you don't want, just keep it blank.
- Specify “yes” when asked to confirm whether the information is correct.
- When prompted for key password again, just press enter. If have warning, just ignore it.
- Go to /opt folder and you will see localhost.jks the keystore you generated previously.
- Copy the generated file to tomcat's home.
- Make localhost.jks owned by tomcat.
- Go to /opt/tomcat9/conf, open the tomcat server.xml file, search for :8080 line and add new line to enable HTTPS.
- Before that, above command need to change the password with what you put previously at number 4.
- Restart tomcat.
- Access tomcat web interface using browser.
https://localhost:8443 orhttps://SERVER_IP:8443 .








Comments