一般開發時不會在tomcat安裝目錄/data/tomcat/webapps/ROOT 下去,上傳部署;而是建立軟連接,在tomcat安裝目錄之外操作,比如執行git pull拉取項目,而tomcat默認不支持軟連接。
1、要讓tomcat支持軟連接,需要在tomcat配置文件conf/context.xml里追加allowLinking="true"(tomcat8開始配置有變),具體如下配置:
<!-- Tomcat 7: -->
<Context allowLinking="true" />
<!-- Tomcat 8: -->
<Context>
<Resources allowLinking="true" />
</Context>


在tomcat建立軟連接:

