1.创建用户

[root@node3 bin]# useradd  -r -M -s /sbin/nologin -u 8080 tomcat


2.安装jsvc工具

[root@node3 bin]# tar xvf commons-daemon-native.tar.gz
[root@node3 bin]# cd commons-daemon-1.0.15-native-src/unix/
[root@node3 unix]# ./configure  --with-java=/usr/local/jdk1.7.0_80
[root@node3 unix]# make
[root@node3 unix]# cp -a jsvc /usr/local/tomcat-7.0.64/bin/

[root@node3 unix]# vim /etc/rc.local
/usr/local/tomcat-7.0.64/bin/jsvc -user tomcat -Djava.util.logging.config.file=/usr/local/tomcat-7.0.64/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -server -Xms1024m -Xmx2048m -XX:PermSize=256M -XX:MaxNewSize=512m -XX:MaxPermSize=256m -Djava.awt.headless=true -Djava.endorsed.dirs=/usr/local/tomcat-7.0.64/endorsed -classpath /usr/local/tomcat-7.0.64/bin/bootstrap.jar:/usr/local/tomcat-7.0.64/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat-7.0.64 -Dcatalina.home=/usr/local/tomcat-7.0.64 -Djava.io.tmpdir=/usr/local/tomcat-7.0.64/temp org.apache.catalina.startup.Bootstrap start

[root@node3 unix]# ps -ef | grep -i  tomcat
tomcat   19857 19856  4 16:40 ?        00:00:47 jsvc.exec -user tomcat -Djava.util.logging.config.file=/usr/local/tomcat-7.0.64/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -server -Xms1024m -Xmx2048m -XX:PermSize=256M -XX:MaxNewSize=512m -XX:MaxPermSize=256m -Djava.awt.headless=true -Djava.endorsed.dirs=/usr/local/tomcat-7.0.64/endorsed -classpath /usr/local/tomcat-7.0.64/bin/bootstrap.jar:/usr/local/tomcat-7.0.64/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat-7.0.64 -Dcatalina.home=/usr/local/tomcat-7.0.64 -Djava.io.tmpdir=/usr/local/tomcat-7.0.64/temp org.apache.catalina.startup.Bootstrap start
root     20384 19920  0 16:58 pts/1    00:00:00 grep -i fron
[root@node3 unix]#