Install Tomcat Linux



References:

Steps To Install Tomcat For Linux:

  1. Get apache-tomcat-9.0.73.tar.gz at https://tomcat.apache.org/download-90.cgi .

  2. 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.
  3. Copy apache-tomcat-9.0.73.tar.gz to /opt folder.

  4. Go to /opt and extract tomcat 9 file.



  5. Move tomcat files from the one created to the new one named tomcat9.



  6. Create a new user named tomcat.


  7. Make tomcat folder owned by tomcat user.


  8. Create a tomcat.service unit file under /etc/systemd/system/     .


  9. Value Inside tomcat.service     .



  10. Reload the systemd configuration.


  11. Start the tomcat service, enable it to auto-start at system boot and check the status.


  12. Access tomcat web interface using browser . Use this link to open Tomcat page http://localhost:8080/ .

Steps To Enable HTTPS SSL on Tomcat:

  1. Stop Tomcat service.
  2. Go to your OpenJDK or JRE folder. Example like below.

  3. Generate a self signed certificate.


  4. Specify password. Please make sure that you remember your password or maybe you can keep it somewhere safe.

  5. Specify First and last Name. Put anything you want.

  6. Specify organizational unit, organization, City or Locality, State or Province, and country code. If you don't want, just keep it blank.

  7. Specify “yes” when asked to confirm whether the information is correct.

  8. When prompted for key password again, just press enter. If have warning, just ignore it.

  9. Go to /opt folder and you will see localhost.jks the keystore you generated previously.

  10. Copy the generated file to tomcat's home.

  11. Make localhost.jks owned by tomcat.

  12. Go to /opt/tomcat9/conf, open the tomcat server.xml file, search for :8080 line and add new line to enable HTTPS.


  13. Before that, above command need to change the password with what you put previously at number 4.

  14. Restart tomcat.


  15. Access tomcat web interface using browser. https://localhost:8443 or https://SERVER_IP:8443 .



Comments

Archive

Contact Form

Send