运行tomcat 需要安装java环境:
下载地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
下载了:jdk-8u144-linux-x64.rpm
卸载之前的openjdk
:rpm -qa | grep -E'^open[jre|jdk]|j[re|dk]'
:yum remove java-1.8.0-openjdk
:yum remove java-1.8.0-openjdk-headless
安装:rpm -ivh jdk-8u144-linux-x64.rpm
:环境变量 export JAVA_HOME=/usr/java/default
tomcat daemon.sh 启动 操作步骤:
wgethttp://archive.apache.org/dist/tomcat/tomcat-8/v8.5.12/bin/apache-tomcat-8.5.12-deployer.tar.gz tar-zxvfapache-tomcat-8.5.12-deployer.tar.gz mvapache-tomcat-8.5.12-deployer/data/app/tomcat/ cd/data/app/tomcat/bin/ tar-zxvfcommons-daemon-native.tar.gz cdcommons-daemon-1.0.15-native-src/unix ./configure make cpjsvc../.. ./daemon.shstart
ok
系统启动 :
cd/usr/lib/systemd/system vimtomcat.service
[Unit] Description=Tomcat After=syslog.targetnetwork.targetremote-fs.targetnss-lookup.target [Service] Type=forking Environment=JAVA_HOME=/usr/java/default ExecStart=/data/app/tomcat/bin/daemon.shstart ExecStop=/data/app/tomcat/bin/daemon.shstop PrivateTmp=true [Install] WantedBy=multi-user.target
systemctldaemon-reload systemctlenabletomcat.service systemctlstoptomcat.service原文链接:https://www.f2er.com/centos/376080.html