1) 安装jdk包 安装目录/opt
sh jdk-1_5_0_06-linux-i586.bin
然后点击yes即可
2) 解压apache-tomcat包 解压目录/opt
tar -zxvf apache-tomcat6.0.32.tat.gz
3) 修改环境变量
vim /etc/profile
export JAVA_HOME=/opt/jdk1.5.0_06
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
export CLASSPATH=.:/opt/jdk1.5.0_06/lib:/opt/jdk1.5.0_06/jre/lib:$CLASSPATH
export JRE_HOME=/opt/jdk1.5.0_06/jre
使环境变量生效 source /etc/profile
4) 查看环境变量
env | grep JAVA_HOME
env | grep PATH
5) 启动tomcat服务
[root@nagios ~]# /opt/apache-tomcat-6.0.32/bin/startup.sh
6) 关闭tomcat服务
[root@nagios ~]# /opt/apache-tomcat-6.0.32/bin/shutdown.sh