tomcat部署,设置jdk环境、jvm内存等
tomcat的catalina.sh(卡特琳娜)文件中可以指定自定义一个环境文件:setenv.sh
原文:setenv.sh in CATALINA_BASE/bin to keep your customizations separate.
故此添加该文件到bin目录即可设置环境,保存为setenv.sh即可
-----------------------------------------------
#!/bin/sh
export JAVA_HOME=/home/wangzhirui/jdk1.7.0
export JRE_HOME=$JAVA_HOME/jre
export classpath=.:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib/rt.jar
export LD_LIBRARY_PATH=$JAVA_HOME/native/lib:$LD_LIBRARY_PATH
export JAVA_OPTS=" \
-server \
-Xms512M \
-Xmx512M \
-Xss512k \
-XX:PermSize=64M \
-XX:MaxPermSize=300M \
-XX:+AggressiveOpts \
-XX:+UseBiasedLocking \
-XX:+DisableExplicitGC \
-XX:MaxTenuringThreshold=31 \
-XX:+UseConcMarkSweepGC \
-XX:+UseParNewGC \
-XX:+CMSParallelRemarkEnabled \
-XX:+UseCMSCompactAtFullCollection \
-XX:LargePageSizeInBytes=128m \
-XX:+UseFastAccessorMethods \
-XX:+UseCMSInitiatingOccupancyOnly \
-Djava.awt.headless=true"
-----------------------------------------------