linux 安装tomcat

参考博客:点击打开链接

  点击打开链接

补充点:

三、Tomcat配置服务和自启动

1、Tomcat配置服务

执行  启动/停止/重启  脚本,报如下错:
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
造成原因,jdk不是使用 yum 命令安装,我是在window上下载的jdk传到linux上的,tomcat未能自动扫描到,bin/catalina.sh添加如下代码
#                   use nohup so that the Tomcat process will ignore any hangup
#                   signals. Default is "false" unless running on HP-UX in which
#                   case the default is "true"
# -----------------------------------------------------------------------------
## 添加下面俩条代码(写入相应的jdk路径)
export JAVA_HOME=/usr/java/jdk1.6.0_43
export JRE_HOME=/usr/java/jdk1.6.0_43/jre


# OS specific support.  $var _must_ be set to either true or false.
cygwin=false
darwin=false
os400=false
hpux=false
case "`uname`" in
CYGWIN*) cygwin=true;;
Darwin*) darwin=true;;
OS400*) os400=true;;
HP-UX*) hpux=true;;
esac

2.启动异常

    java.lang.NoSuchMethodException:org.apache.catalina.deploy.WebXml              addFilter

    解决办法:在tomacat的配置文件context.xml里加上




你可能感兴趣的:(tomcat)