一.所需的文件 apache-tomcat-5.5.17.tar.gz jdk-1_5_0_02-linux-i586.bin
二.安裝步驟:
#gunzip apache-tomcat-5.5.17.tar.gz
# tar xf apache-tomcat-5.5.17.tar
# mv apache-tomcat-5.5.17 tomcat
# chmod +x jdk-1_5_0_02-linux-i586.bin
# mv jdk-1_5_0_02 jdk
# cd jdk/bin
# ln –s /jdk/bin/java /usr/sbin/java
# cd /tomcat/bin
# vi startup.sh
添加 JAVA_HOME=/jdk
export JAVA_HOME
# vi shutdown.sh
添加 JAVA_HOME=/jdk
export JAVA_HOME
# vi Catalina.sh 添加下列紅字部分
if [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then
. "$CATALINA_HOME"/bin/setenv.sh
fi
CATALINA_OPTS="-Djava.awt.headless=true"
#JAVA_OPTS="-Xms128M -Xmx3096M"
JAVA_OPTS="-Xms256M -Xmx512M"
# For Cygwin, ensure paths are in UNIX format before anything is touched
# cd /tomcat/conf/
# vi tomcat-user.xml 添加下列紅字部分
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="standard"/>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
<user username="zlwt" password="zlwt157" roles="standard,manager,admin"/>
</tomcat-users>
# vi server.xml 把裡邊的8080端口改為80
三.啟動 tomcat
# cd /tomcat/bin/
# ./startup.sh
四.停止 tomcat
# ./shutdown.sh
# ps –ef |grep java 檢查是否啟動