2011年(33)
分类: LINUX
2011-06-05 12:46:14
下载地址:tomcat.apache.org
以tomcat 6为例
1、JDK安装(1.6版)
/opt下执行
sh jdk-6u1-linux-i586.bin
JDK安装目录为/opt/jdk1.6.0_01
mv /opt/jdk1.6.0_01 /opt/jdk1.6
2、解压tomcat
tar xvf tar xvf apache-tomcat-6.0.32.tar.gz
3、改名
mv apache-tomcat-6.0.32 tomcat6
4、编辑环境变量
vi /etc/profile
在文件末尾加入以下内容
export JAVA_HOME=/opt/jdk1.6
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
export TOMCAT_HOME=/opt/tomcat6
保存后执行source profile使环境变量生效
5、启动与停止
启动:tomcat6/bin/startup.sh
[root@localhost bin]# ./startup.sh
Using CATALINA_BASE: /opt/tomcat6
Using CATALINA_HOME: /opt/tomcat6
Using CATALINA_TMPDIR: /opt/tomcat6/temp
Using JRE_HOME: /opt/jdk1.6
Using CLASSPATH: /opt/tomcat6/bin/bootstrap.jar
停止:tomcat6/bin/shutdown.sh
[root@localhost bin]# ./shutdown.sh
Using CATALINA_BASE: /opt/tomcat6
Using CATALINA_HOME: /opt/tomcat6
Using CATALINA_TMPDIR: /opt/tomcat6/temp
Using JRE_HOME: /opt/jdk1.6
Using CLASSPATH: /opt/tomcat6/bin/bootstrap.jar
6、默认端口 8080