Tomcat installation and troubleshooting to solve

Here Insert Picture Description
Presentation environment:
System version : CentOS Linux Release 7.7.1908 (Core)
Tomcat Version : 10.0.0-M3
the JDK version : jdk14 2020-03-17

A, Tomcat yum install

This mounting method and yum source configuration click here

  • yum install drawbacks:
    • Version limit, can be installed only source version, older version
    • yum install tomcat in the system after registration, can not be achieved to install multiple tomcat.

Second, the manual installation

1. JDK download and install

Download the oracle official website. Click here to jump directly

Here Insert Picture Description

mkdir -p /usr/JDK
cd   /usr/JDK
 wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/14+36/076bab302c7b4508975440c56f6cc26a/jdk-14_linux-x64_bin.tar.gz
# 这里更换你的链接就可以,不要删除cookie 部分
# 我这里是13.0.2 版本,不同版本的方法相同
 chmod +x jdk14   
 #  给java目录添加执行权限
 vim /etc/profile 
 # 配置化环境变量,配置如图

Here Insert Picture Description

2.tomcat download and install

  • Download and install Tomcat
    in the tomcat site know the version you want, and then copy the link, download the linux
    I use the demo version 10.0
mkdir -p /www/tomcat 
wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-10/v10.0.0-M3/bin/apache-tomcat-10.0.0-M3.tar.gz
tar zxvf apache-tomcat-10.0.0-M3.tar.gz 
sh bin/startup.sh   #在tomcat目录中,就是你下载的文件解压的那个文件夹

Unzip the file, several copies (you want to run a few, a few copies)
, respectively, to change the port number after the completion of the copy:
vim /conf/server.xml # directory in tomcat, is that the files you unzip the downloaded file folder

 22 <Server port="8006" shutdown="SHUTDOWN"> 
 #修改22行的端口 8005->8006
69     <Connector port="8081" protocol="HTTP/1.1"
  #修改69行的端口 8080-> 8081
 #这几份都要修改,不能重复

Three, Tomcat installation troubleshooting

Click here to see
↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

Four, Tomcat related commands

  • View tomcat process:
    PS the AUX | grep tomcat
  • Start Tomcat
    SH bin / startup.sh
  • Close Tomcat
    SH bin / shutdown.sh
  • Restart achieved by closing open
Published 77 original articles · won praise 540 · views 50000 +

Guess you like

Origin blog.csdn.net/weixin_42767604/article/details/105347110