标签:msi ati pat cms star unix 堆内存 ali tools
用tomcat用户开机启动groupadd tomcat
useradd -g tomcat tomcat -s /sbin/nologin
chown tomcat.tomcat -R /usr/local/tomcat/*
cd /usr/local/tomcat/bin/
tar xf commons-daemon-native.tar.gz
cd commons-daemon-1.1.0-native-src/unix/
./configure --with-java=$JAVA_HOME
make
cp jsvc /usr/local/tomcat/bin/
cp /usr/local/tomcat/bin/daemon.sh /etc/init.d/tomcat
vim /etc/init.d/tomcat
#!/bin/sh
# chkconfig: 2345 81 91
# description: Start and Stop tomcat
JAVA_HOME=/usr/local/jdk8.0
JAVA_BIN=/usr/local/jdk8.0/bin
CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
CATALINA_BASE=/usr/local/tomcat
CATALINA_HOME=/usr/local/tomcat
JAVA_OPTS="-server
-Xms1024m
-Xmx1536m
-XX:PermSize=256m
-XX:MaxPermSize=512m
-XX:+UseConcMarkSweepGC
-XX:+UseCMSCompactAtFullCollection
-XX:CMSFullGCsBeforeCompaction=0
-XX:-PrintGC
-XX:-PrintGCDetails
-XX:-PrintGCTimeStamps
-Xloggc:../logs/gc.log "
## -Xmx1536m 堆内存最大允许大小,一般不要大于物理内存的80%
/etc/init.d/tomcat start
chkconfig tomcat on
标签:msi ati pat cms star unix 堆内存 ali tools
原文地址:http://blog.51cto.com/hequan/2065086