新搭建一个 tomcat 需要修改的文件

以下以10.117.37.115 cbms 用户下新增 tomcat 为例:

  1. 修改启动和停止服务的脚本文件中的环境变量

    vi ~cbms/tomcat_cbms/bin/startup.sh
    vi ~cbms/tomcat_cbms/bin/shutdown.sh

    export CATALINA_HOME=/home/cbms/tomcat_cbms
    export CATALINA_BASE=/home/cbms/tomcat_cbms
    export TOMCAT_HOME=/home/cbms/tomcat_cbms
    export CATALINA_TMPDIR=/home/cbms/tomcat_cbms/temp

  2. 修改端口号
    需要修改3个端口号:

    <Server port="9401" shutdown="SHUTDOWN">
    ...
    <Connector port=“9402" protocol="HTTP/1.1” connectionTimeout=“20000" redirectPort="8443" URIEncoding="UTF-8" />
    ...
    <Connector port=“9403" protocol="AJP/1.3" redirectPort="8443" />
    ...
  3. 修改项目路径

    vi ~cbms/tomcat_cbms/conf/server.xml

    最下面:

    <Host name="localhost"  appBase="/home/zzwx/webapps/zztt/wap"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
                    <Context path=""  docBase="/home/zzwx/webapps/zztt/wap/tomcat" reloadable="true" debug="0"> </Context>
                    <Context path="/sso"  docBase="/home/zzwx/webapps/zztt/sso/tomcat" reloadable="true" debug="0"> </Context>
    </Host>
  4. 防火墙放开端口号

    firewall-cmd --permanent --add-port=9402/tcp
    firewall-cmd --reload
2016-03-10 23:371