1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| wget https://dlcdn.apache.org/tomcat/tomcat-8/v8.5.89/bin/apache-tomcat-8.5.89.tar.gz tar xf apache-tomcat-8.5.89.tar.gz -C /usr/local cd /usr/local ln -s apache-tomcat-8.5.89 tomcat echo 'PATH=/usr/local/tomcat/bin:$PATH' > /etc/profile.d/tomcat.sh . /etc/profile.d/tomcat.sh useradd -r -s /sbin/nologin tomcat
chown -R tomcat.tomcat /usr/local/tomcat/ echo 'JAVA_HOME=/usr/local/jdk' /usr/local/tomcat/conf/tomcat.conf
vim /lib/systemd/system/tomcat.service [Service] Type=forking
EnvironmentFile=/usr/local/tomcat/conf/tomcat.conf
ExecStart=/usr/local/tomcat/bin/startup.sh ExecStop=/usr/local/tomcat/bin/shutdown.sh PrivateTmp=true User=tomcat Group=tomcat [Install] WantedBy=multi-user.target
systemctl daemon-reload
sysemctl start tomcat systemctl status tomcat ss -ntl
|