1,解压apache-tomcat-5.5.28.tar.gz,会创建apache-tomcat-5.5.28目录
2,将apache-tomcat-5.5.28目录移至/home/wangfeng (同样使用mv命令)
3,设置TOMCAT环境变量:sudo gedit /etc/profile
在前面加入的JDK环境变量下面再加一行
export CATALINA_HOME=/home/wangfeng/apache-tomcat-5.5.28
4重启(环境变量的修改要重启才能生效)
5,$ sudo cd /home/wangfeng/apache-tomcat-5.5.28/bin
$ ./startup.sh
如果此时提示以下信息:
The BASEDIR environment variable is not defined correctly
This environment variable is needed to run this program
表明startup.sh中用到的相关.sh文件的执行权限不够
6,给apache-tomcat-5.5.28下所有.sh文件加权限(此时,你的当时路径还是处于/home/wangfeng/apache-tomcat-5.5.28/bin下,不在的话请自行加上路径或先进入这个目录)
$ sudo chmod +x *.sh
7,再次运行startup.sh,出现以下提示信息则表示启动成功
Using CATALINA_BASE: /home/wangfeng/apache-tomcat-5.5.28
Using CATALINA_HOME: /home/wangfeng/apache-tomcat-5.5.28
Using CATALINA_TMPDIR: /home/wangfeng/apache-tomcat-5.5.28/temp
Using JRE_HOME: /home/wangfeng/jdk1.5.0_05/jre
Using CLASSPATH: /home/wangfeng/apache-tomcat-5.5.28/bin/bootstrap.jar
8、在浏览器输入http://localhost:8080/即可看到熟悉的tomcat首页了