1.webapps下有兩個項目 projectA,projectB.兩個項目除開管理信息接口,其他都有安全驗證機制.
2.projectA因爲未作先後端分離,所以靜態資源也存在java項目中.在作靜態資源中的接口請求時未寫包名,好比登陸,js代碼會拼接服務器ip+端口+當前設置的url(/login),而未在/login前加上/projectA,因此在本機上測試沒有問題,只有當部署的時候纔會存在這樣的問題.這也是個問題,下面解決.
3.projectB是運行正常的項目html
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="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" /> <Context path="" docBase="/usr/tomcat8.6/webapps/sc_edu" debug="0" reloadable="true"/> </Host>
<Context path="" docBase="/usr/tomcat8.6/webapps/sc_edu" debug="0" reloadable="true"/>
$> cp -r tomcat8.5/ tomcat8.6/
<Context path="" docBase="/usr/tomcat8.6/webapps/sc_edu" debug="0" reloadable="true"/>
改動 shutdown對應的port爲8006,只要與tomcat8.5不一樣且端口不衝突就行.java
<Server port="8006" shutdown="SHUTDOWN">
改動 請求對應的端口,原則同上web
<Connector port="8081" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />