The environment

  • Linux/Ubuntu20.04 LTS
  • Tomcat8.5.68

process

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

  1. Go to the download directory, open the terminal, begin to unpack the downloaded package, and unpack it into the user’s self-installed directory, that is, /usr/local directory. After unpacking, you can see the Tomcat file successfully unpacked in this directory
lauiji@lauiji-IdeaPad-15sIML-2020:~/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. General users may not have enough permissions to use the folder directory they unzip and install by themselves, so they start to modify the permissions to the folder directory and enter the /usr/local directory, where 755 is rwxr-xr-x and -r is the same permissions to all files in the directory.
lauiji@lauiji-IdeaPad-15sIML-2020:/usr/local$sudo chmod 755-r apache-tomcat-8.5.68/ [sudo] Lauiji's password:

Note: If you are using the ZSH interpreter on a Mac, put -r before 755, otherwise it will tell you that the directory does not exist!

View directory permissions

lauiji@lauiji-IdeaPad-15sIML-2020:/usr/local$ ll
总用量 48
···
drwxr-xr-x  9 root root 4096 6月  26 11:07 apache-tomcat-8.5.68/

Note: $ls -l apache-tomcat-8.5.68 if you are using the ZSH interpreter on Mac

  1. Run the service, go to the bin in the Tomcat directory, and run startup.sh
Lauiji @ lauiji - siml IdeaPad - 15-2020: / usr/local/apache tomcat - 8.5.68 $. / bin/startup. Sh Using CATALINA_BASE: /usr/local/apache-tomcat-8.5.68 Using CATALINA_TMPDIR: /usr/local/apache-tomcat /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
Lauiji @ lauiji - siml IdeaPad - 15-2020: / usr/local/apache tomcat - 8.5.68 $. / bin/shutdown. Sh Using CATALINA_BASE: /usr/local/apache-tomcat-8.5.68 Using CATALINA_TMPDIR: /usr/local/apache-tomcat /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 not enough, running the service will appear individual files cannot access the problem, resulting in the service operation failure!

The service is now accessible through the browser, localhost:8080. If the port conflicts or you want to change the port, change the conf/server.xml file in the Tomcat directory

In the rainy season, eat the rainbow