分类: LINUX
2007-06-01 21:12:26
一.所需的文件 apache-tomcat- jdk-1_5_0_02-linux-i586.bin 二.安装步骤: #gunzip apache-tomcat- # tar xf apache-tomcat- # mv apache-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="-Xms JAVA_OPTS="-Xms # For Cygwin, ensure paths are in UNIX format before anything is touched # cd /tomcat/conf/ # vi tomcat-user.xml 添加下列红字部分
# vi server.xml 把里边的8080端口改为80 三.启动 tomcat # cd /tomcat/bin/ # ./startup.sh 四.停止 tomcat # ./shutdown.sh # ps –ef |grep java 检查是否启动
五.设置开机自动启动
在 /etc/rc3.d/ 下新建一个文件如:S98tomcat
并添加下面内容:假设tomcat安装在 /app下
case "$1" in start) echo "Starting tomcat..." /app/tomcat/bin/startup.sh ;; stop) echo "Stopping tomcat..." /app/tomcat/bin/shutdown.sh ;; *) echo "Usage tomcat start/stop" exit 1;; esac |