tags: Linux
DevOps
Jenkins
Tomcat
上一篇
【Jenkins】利用Jenkins將SVN上的Vaadin Project定期自動化布署至Tomcat
Context path
Context path | war | 資料夾名稱 | URL |
---|---|---|---|
/ | ROOT.war | ROOT | http://192.168.10.37:9003/ |
/test | test.war | test | http://192.168.10.37:9003/test |
- Tomcat解壓縮後,webapps有的資料夾
- 若路徑是"/",則Jenkins會將war檔從[Jenkins home]複製過去時,將war檔名稱改為ROOT
- 但ROOT原本是Tomcat的預設畫面
Jenkins 錯誤訊息
The username you provided is not allowed to use the text-based Tomcat Manager (error 403)
Solution 解決辦法
- 編輯tomcat user設定
sudo vim /usr/local/tomcat/conf/tomcat-users.xml
- 添加
<tomcat-users> ... <role rolename="manager-script"/> <user username="admin" password="admin" roles="manager-script"/> </tomcat-users>
- 編輯
sudo vim /usr/local/tomcat/webapps/manager/META_INF/context.xml
- 註解
<tomcat-users> ... <role rolename="manager-script"/> <user username="admin" password="admin" roles="manager-script"/> </tomcat-users>
- 編輯
sudo vim /usr/local/tomcat/webapps/manager/META_INF/context.xml
- 註解
<Context antiResourceLocking="false" privileged="true" > <CookieProcessor className="org.apache.tomcat.util.http.Rfc6265CookieProcessor" sameSiteCookies="strict" /> <!-- <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> <Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/> --> </Context>
- 重新建置Jenkins專案
沒有留言:
張貼留言