Tomcat後臺管理賬號密碼問題和 403錯誤問題

tomcat 後臺管理需要登陸密碼

登錄tomcat後臺管理系統 http://localhost:8080/manager/html 發現需要密碼,於是搜尋總結。
tomcat:9.0.17 OS:windows

打開 D:/tomcat/conf/ 目錄下的 tomcat-users.xml

<!--
將以下代碼
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="tomcatT" roles="tomcat"/>
  <user username="both" password="tomcatT" roles="tomcat,role1"/>
  <user username="role1" password="tomcatT" roles="role1"/>
 -->
 取消掉註釋<!--     -->,變爲
   <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="tomcatT" roles="tomcat"/>
  <user username="both" password="tomcatT" roles="tomcat,role1"/>
  <user username="role1" password="tomcatT" roles="role1"/>
再加上
<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>


若不加

<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>

重啓,發現問題
在這裏插入圖片描述
加上

<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>

好了。可以打開頁面了
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章