hanwentan 2012-02-06
1.下载apache安装文件(二进制文件)http://mirror.bjtu.edu.cn/apache/tomcat/tomcat-5/v5.5.35/bin/apache-tomcat-5.5.35.tar.gz
2.解压apache-tomcat-5.5.12.tar.gz 放在/usr/local下面
tar -zxvf apache-tomcat-5.5.12.tar.gz 解包apache
/usr/local下面将解出的目录重命名mv apache-tomcat-5.5.12 tomcat5.5
3.配置 /etc/profile (环境变量)
vi /etc/profile文件最后面把下面一段加上去
JDK_HOME=/usr/java/jdk1.6.0_10(必须是jdk的安装路径)
CATALINA_HOME=/usr/local/tomcat5.5(必须为tomcat安装路径)
JRE_HOME=/usr/java/jdk1.6.0_10(必须是jdk的安装路径)source /etc/profile 重新载入系统path配置
4.启动tomcat
先输入命令 : sh /usr/local/tomcat5.5/bin/startup.sh
Using CATALINA_BASE: /usr/local/tomcat5.5
UsingCATALINA_HOME:/usr/local/tomcat5.5
UsingCATALINA_TMPDIR:/usr/local/tomcat5.5/temp
Using JRE_HOME: /usr/java/jdk1.6.0_10然后输入命令: ps -elf | grep tomcat 有类似下面的提示出现证明tomcat 启动成功
0Sroot1199714800-71629stext10:38pts/000:00:03/usr/java/jdk1.6.0_30/bin/java-Djava.util.logging.config.file=/usr/local/software/tomcat5.5/conf/logging.properties-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager-Djava.endorsed.dirs=/usr/local/software/tomcat5.5/common/endorsed-classpath/usr/local/software/tomcat5.5/bin/bootstrap.jar-Dcatalina.base=/usr/local/software/tomcat5.5-Dcatalina.home=/usr/local/software/tomcat5.5-Djava.io.tmpdir=/usr/local/software/tomcat5.5/temporg.apache.catalina.startup.Bootstrapstart
0 S root 12067 8069 0 78 0 - 1041 pipe_w 10:39 pts/0 00:00:00 grep tomcat5.测试tomcat
http://localhost:80808080默认端口号,也可以在配置文件中改掉
会出现tomcat的示例页面
安装完成