yum install -y java-1.7.0-openjdk
tar zxf apache-tomcat-7.0.65.tar.gz -C /usr/local/
cd /usr/local/
ln -s apache-tomcat-7.0.65/ tomcat
vim /etc/profile.d/tomcat.sh
export CATALINA_HOME=/usr/local/tomcat
export PATH=$PATH:$CATALINA_HOME/bin
. /etc/profile.d/tomcat.sh
vim /etc/init.d/tomcat
#!/bin/sh
# Tomcat init script for Linux.
#
# chkconfig: 2345 96 14
# description: The Apache Tomcat servlet/JSP container.
JAVA_OPTS=‘-Xms64m -Xmx128m‘
JAVA_HOME=/usr
CATALINA_HOME=/usr/local/tomcat
export JAVA_HOME CATALINA_HOME
exec $CATALINA_HOME/bin/catalina.sh $*
chmod +x /etc/init.d/tomcat
chkconfig --add tomcat
service tomcat start
时间: 2024-12-07 02:05:27