tomcat常用操作整理

系统+安全 Liemer_Lius 1045℃ 0评论

1、添加用户

首先,找到配置文件的位置:

/usr/local/tomcat/conf/tomcat-users.xml

编辑以上配置文件,在<tomcat-users>标签下,添加相关的用户配置:

<tomcat-users>  
<!--  
  NOTE:  By default, no user is included in the "manager-gui" role required  
  to operate the "/manager/html" web application.  If you wish to use this app,  
  you must define such a user - the username and password are arbitrary.  
-->  
<!--  
  NOTE:  The sample user and role entries below are wrapped in a comment  
  and thus are ignored when reading this file. Do not forget to remove  
  <!.. ..> that surrounds them.  
-->  
  
<role rolename="tomcat"/>  
  <role rolename="role1"/>  
  <role rolename="manager-gui"/>  
  <role rolename="manager-script"/>  
  <role rolename="manager-jmx"/>  
  <role rolename="manager"/>  
  <role rolename="manager-status"/>  
  <user username="tomcat" password="tomcat" roles="tomcat"/>  
  <user username="both" password="tomcat" roles="tomcat,role1"/>  
  <user username="role1" password="tomcat" roles="role1"/>  
  <user username="admin" password="admin" roles="manager,manager-gui,manager-script,manager-jmx,manager-status"/>  
  
</tomcat-users>  

重启tomcat后生效。

2、修改app项目默认路径

> vim /usr/local/tomcat-lius_8.5.65/conf/server.xml
<Host name="localhost"  appBase="webapps/ROOT"     // 根据实际地址修改即可

 

 

 

 

 

转载请注明:liutianfeng.com » tomcat常用操作整理

喜欢 (0)

发表回复