tomcat restart webapp from command line

前端 未结 5 2208
南旧
南旧 2020-12-28 14:53

I have a PCI DSS compliant environment which runs several apps and I want to restart only one app without restarting the server. I don\'t have the manager because apparently

5条回答
  •  梦毁少年i
    2020-12-28 15:25

    Here's how I do it:

    1. Ensure that you have user with "manager-script" role in your tomcat user database. That usually means that you have line like this in your ${TOMCAT}/conf/tomcat-users.xml :
    
    

    Otherwise, you will get a 403 error because of cross-site request forgery (CSRF) protection.

    1. Use curl or whatever command line tool you like to fetch the URl /manager/text/reload?path=/:

      curl --user user:secret http://localhost:8080/manager/text/reload?path=/mypath  
      

提交回复
热议问题