linux下安裝第二個tomcat
如第二個tomcat安裝路徑為:/usr/local/tomcat_2
再 /etc/目錄下的profile 檔案進行編輯
vi /etc/profile
找到文件最末端,進行新增:(對比看看缺少那部分,一般是紅色部分)
export JAVA_HOME="/usr/java/jdk1.7.0_04" export PATH= ".:$PATH:$JAVA_HOME/bin" export CLASSPATH= "$JAVA_HOMEb:$JAVA_HOME/jreb" ##########first tomcat########### CATALINA_BASE=/usr/local/tomcat CATALINA_HOME=/usr/local/tomcat TOMCAT_HOME=/usr/local/tomcat export CATALINA_BASE CATALINA_HOME TOMCAT_HOME ##########first tomcat############ ##########second tomcat########## CATALINA_2_BASE=/usr/local/tomcat_2再來到第二個tomcat的bin目錄下,再catalina.sh中加入:
export JAVA_HOME="/usr/java/jdk1.7.0_04" export PATH=".:$PATH:$JAVA_HOME/bin" export CLASSPATH= "$JAVA_HOMEb:$JAVA_HOME/jreb" ###以上三個環境變數就是JAVA的環境變數### export CATALINA_BASE=$CATALINA_2_BASE export CATALINA_HOME=$CATALINA_2_HOME更改埠:
再server.xml中修改紅色字型部分
<Host name="localhost" appBase="/xiangmu_lujing"
unpackWARs="true" autoDeploy="true">
<Context path="" debug="0" docBase="/xiangmu_lujing" reloadable="true" />
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
文章參考:http://blog.csdn.net/qq_29246225/article/details/52250813
http://blog.csdn.net/tanjie_123/article/details/52350372