我当前运行的Tomcat如下
Tomcat Version : Apache Tomcat/5.5.36
Servlet Specification Version : 2.4
JSP version : 2.0
我需要改成它
Tomcat Version : Apache Tomcat/8.0.14
Servlet Specification Version : 3.1
JSP version : 2.3
我下载了Tomcat版本8,我有以下内容,如何运行Tomcat 8并使其成为服务器的默认设置?
root@server [/opt]# ls
./ cpanel/ pcre/
../ curlssl/ PHP_with_imap_client/
apache-tomcat-8.0.18/ jdk1.7.0_75/ suPHP/
apache-tomcat-8.0.18.tar.gz jdk-7u75-linux-x64.tar.gz xml2/
我尝试了以下命令,但失败了.
root@server [/opt/apache-tomcat-8.0.18/bin]# ./startup.sh
Cannot find apache-tomcat-8.0.18/bin/setclasspath.sh
This file is needed to run this program
在〜/ .bashrc
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
JAVA_HOME="/usr/lib/jvm/jre-1.7.0-openjdk.x86_64"
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
export CATALINA_HOME="apache-tomcat-8.0.18"
Java版本
java -version
java version "1.7.0_75"
OpenJDK Runtime Environment (rhel-2.5.4.0.el6_6-x86_64 u75-b13)
OpenJDK 64-Bit Server VM (build 24.75-b04,mixed mode)
root@server [/opt/apache-tomcat-8.0.18/bin]#
O / S
Linux server.myproject.com 2.6.32-220.13.1.el6.x86_64 #1 SMP Tue Apr 17
23:56:34 BST 2012 x86_64 x86_64 x86_64 GNU/Linux
最佳答案
Tomcat startup.sh脚本使用$CATALINA_HOME查找setclasspath.sh,这是启动失败的原因.因此,$CATALINA_HOME需要是tomcat安装目录的绝对路径,例如
原文链接:/linux/440957.htmlexport CATALINA_HOME =“/ opt / apache-tomcat-8.0.18”
如果您计划再次升级,可以考虑将$CATALINA_HOME设置为/ opt / tomcat,然后创建从/ opt / tomcat到/opt/apache-tomcat-8.0.18的符号链接或者您最终安装的任何未来版本.由于您可能有多个环境变量指向您的tomcat目录,因此在更新引用时会为您提供单个更改点.
ln -nsf /opt/apache-tomcat-8.0.18 / opt / tomcat