我用的是 fedora 12 自待的jdk 1.6 在 /usr/lib/jvm/java-1.6.0-openjdk
第一步:把apache-tomcat-6.0.26.tar.gz解压后放到/usr/local/下重命名为apache-tomcat-6.0.26
第二步:在/etc/profile文件中适当的位置添加如下环境变量
CATALINA_HOME=/usr/local/apache-tomcat-6.0.26
CATALINA_BASE=/usr/local/apache-tomcat-6.0.26
CATALINA_TMPDIR=/usr/local/apache-tomcat-6.0.26
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk
CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/jre/lib/rt.jar
PATH=$JAVA_HOME/bin:$PATH:$CATALINA_HOME/bin
export JAVA_HOME CLASSPATH PATH
export CATALINA_HOME CATALINA_BASE CATALINA_TMPDIR
保存后运行 sh /etc/profile更新环境设置
第三步:运行 sh /usr/local/apache-tomcat-6.0.26/bin/startup.sh启动tomcat
得到如下输出则启动成功
[root@Linux-Fedora bin]# sh startup.sh
Using CATALINA_BASE: /usr/local/apache-tomcat-6.0.26
Using CATALINA_HOME: /usr/local/apache-tomcat-6.0.26
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-6.0.26/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/local/apache-tomcat-6.0.26/bin/bootstrap.jar
第四步:在浏览器中输入127.0.0.1:8080就能看见tomcat的启动页了