Installing Tomcat service for Ubuntu

Time:2021-7-28

environment

  • Linux/Ubuntu20.04LTS
  • Tomcat8.5.68

technological process

  1. Download the Tomcat service installation package,https://tomcat.apache.org/dow…, select the version you want to download. The version you want to download here is 8.5, and the compressed package in tar.gz (PGP, SHA512) format.

Installing Tomcat service for Ubuntu

  1. Enter the download directory, open the terminal, start decompressing the downloaded compressed package and decompress it to the user’s own installation directory, that is, the / usr / local directory. After decompressing, you can see the successfully decompressed Tomcat file in this directory
[email protected]:~/Downloads$ sudo tar -zxvf apache-tomcat-8.5.68.tar.gz -C /usr/local

apache-tomcat-8.5.68/conf/
apache-tomcat-8.5.68/conf/catalina.policy
···
apache-tomcat-8.5.68/bin/tool-wrapper.sh
apache-tomcat-8.5.68/bin/version.sh
  1. Generally, users may have insufficient permissions to decompress the installed folder directory. Start to modify the folder directory and enter the / usr / local directory. 755, that is, rwxr-xr-x, – R, that is, all files in the directory have the same permissions.
[email protected]:/usr/local$ sudo chmod 755 -R apache-tomcat-8.5.68/
[sudo] lauiji's password:

Tip: if the Zsh interpreter is used under Mac, put – r before 755, otherwise it will prompt that the directory does not exist!

View directory permissions

[email protected]:/usr/local$ ll
Total dosage 48
···
Drwxr-xr-x 9 root 4096 June 26 11:07 apache-tomcat-8.5.68/

Tip: if the Zsh interpreter is used under Mac, the command is $LS – L apache-tomcat-8.5.68

  1. Run the service, enter bin under Tomcat directory, and run startup.sh
[email protected]:/usr/local/apache-tomcat-8.5.68/bin$ ./startup.sh
Using CATALINA_BASE:   /usr/local/apache-tomcat-8.5.68
Using CATALINA_HOME:   /usr/local/apache-tomcat-8.5.68
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.5.68/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/local/apache-tomcat-8.5.68/bin/bootstrap.jar:/usr/local/apache-tomcat-8.5.68/bin/tomcat-juli.jar
Using CATALINA_OPTS:   
Tomcat started.
  1. Shut down the service and run shutdown.sh
[email protected]:/usr/local/apache-tomcat-8.5.68/bin$ ./shutdown.sh
Using CATALINA_BASE:   /usr/local/apache-tomcat-8.5.68
Using CATALINA_HOME:   /usr/local/apache-tomcat-8.5.68
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.5.68/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/local/apache-tomcat-8.5.68/bin/bootstrap.jar:/usr/local/apache-tomcat-8.5.68/bin/tomcat-juli.jar
Using CATALINA_OPTS:   
NOTE: Picked up JDK_JAVA_OPTIONS:  --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED

Tip: if the permission is insufficient, the problem that individual files cannot be accessed will occur when running the service, resulting in service failure!

When the service is running, you can access it through the browser. Localhost: 8080. If the ports conflict or you want to modify the ports, modify the conf / server.xml file in the Tomcat directory

[in rainy season, eat rainbow] – layuji

Recommended Today

Implementation example of go operation etcd

etcdIt is an open-source, distributed key value pair data storage system, which provides shared configuration, service registration and discovery. This paper mainly introduces the installation and use of etcd. Etcdetcd introduction etcdIt is an open source and highly available distributed key value storage system developed with go language, which can be used to configure sharing […]