###安裝tomcat8java
$ cd /home/ $ wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.5.4/bin/apache-tomcat-8.5.4.tar.gz $ tar zxvf apache-tomcat-8.5.4.tar.gz $ mv apache-tomcat-8.5.4 tomcat8 && cd tomcat8
#add tomcat pid CATALINA_PID="$CATALINA_BASE/tomcat.pid" #add java opts JAVA_OPTS="-server -XX:PermSize=512M -XX:MaxPermSize=1024m -Xms1024M -Xmx2048M -XX:MaxNewSize=512m " JAVA_OPTS="$JAVA_OPTS -Djava.security.egd=file:/dev/./urandom"
tomcat.util.scan.StandardJarScanFilter.jarsToSkip=
*.jarapache
vi /usr/lib/systemd/system/tomcat.servicetomcat
[Unit] Description=Tomcat8 After=syslog.target network.target remote-fs.target nss-lookup.target [Service] Type=forking PIDFile=/home/tomcat8/tomcat.pid ExecStart=/home/tomcat8/bin/startup.sh ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target
$ systemctl enable tomcat $ systemctl daemon-reload $ systemctl restart tomcat