tomcat提供了一個管理程序:manager,它用於查看部署到tomcat服務器中的web應用程序。
要訪問manager web應用程序,須要添加具備管理員權限的帳號。即須要去編輯/conf/tomcat-users.xml文件。具體以下
1.啓動tomcat
2.在瀏覽器輸入http://localhost:8080/
出現以下界面
右上角很明顯有個Manager App與Host Manager
3.咱們須要查看運行的App,所以點擊Manager App,出現以下頁面
點擊取消,會出現以下頁面
很明顯是讓咱們修改 conf/tomcat-users.xml文件, add the admin-gui role to a user named tomcat with a password of s3cret,添加一個管理員角色,併爲其設置帳號與密碼,格式以下html
<role rolename="admin-gui"/> <user username="tomcat" password="s3cret" roles="admin-gui"/>
我這裏設置帳號lxl,密碼123456,重啓tomcat,在瀏覽器輸入http://localhost:8080/,點擊Manager App,輸入帳號與密碼,即到了這個頁面http://localhost:8080/manager/html,圖以下web