1. 程式人生 > >Tomcat8訪問管理頁面localhost出現:403 Access Denied

Tomcat8訪問管理頁面localhost出現:403 Access Denied

問題:

403 Access Denied

You are not authorized to view this page.

If you have already configured the Manager application to allow access and you have used your browsers back button, used a saved book-mark or similar then you may have triggered the cross-site request forgery (CSRF) protection that has been enabled for
the HTML interface of the Manager application. You will need to reset this protection by returning to the main Manager page. Once you return to this page, you will be able to continue using the Manager appliction's HTML interface normally. If you continue to see this access denied message, check that you have the necessary permissions to access this application.
If you have not changed any configuration files, please examine the file conf/tomcat-users.xml in your installation. That file must contain the credentials to let you use this webapp. For example, to add the manager-gui role to a user named tomcat with a password of s3cret, add the following to the config file listed above.
<role rolename="manager-gui"/> <user username="tomcat" password="s3cret" roles="manager-gui"/> Note that for Tomcat 7 onwards, the roles required to use the manager application were changed from the single manager role to the following four roles. You will need to assign the role(s) required for the functionality you wish to access. manager-gui - allows access to the HTML GUI and the status pages manager-script - allows access to the text interface and the status pages manager-jmx - allows access to the JMX proxy and the status pages manager-status - allows access to the status pages only The HTML interface is protected against CSRF but the text and JMX interfaces are not. To maintain the CSRF protection: Users with the manager-gui role should not be granted either the manager-script or manager-jmx roles. If the text or jmx interfaces are accessed through a browser (e.g. for testing since these interfaces are intended for tools not humans) then the browser must be closed afterwards to terminate the session.

tomcat-users.xml配置內容為:

<!--
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <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"/> 

</tomcat-users>

解決方案:

<user username="admin" password="admin" roles="manager"/>改為:

<user username="admin" password="admin" roles="manager-gui"/>即可。

原因是tomcat8中role已經manager換為manager-gui了。

相關推薦

Tomcat8訪問管理頁面localhost出現403 Access Denied

問題: 403 Access Denied You are not authorized to view this page. If you have already configured the Manager application to allow access and you ha

Tomcat8.5管理頁面403 Access Denied的解決方法

編程語言 Java tomcat 管理頁面 403錯誤 安裝tomcat之後,訪問server status、manager app、host manager等頁面,出現403 Access Denied錯誤, 解決方法:1. 在conf/tomcat-users.xml文件裏面,在&l

tomcat8以上管理頁面提示403問題

pri span use eba 還需要 conf LV add AD 修改conf/tomcat-users.xml <role rolename="manager"/> <role rolename="manager-gui"/> <ro

tomcat 中的 tomcat-users.xml 配置不生效原因 + tomcat8以上管理頁面提示403問題解決方案

首先確定在conf目錄下的server.xml檔案有  <GlobalNamingResources>    <!-- Editable user database that can also be used by         UserDatabase

Springboot訪問jsp頁面報錯javax.servlet.jsp.JspFactory.getJspApplicationContext

搭建springboot專案時,專案啟動成功,訪問jsp頁面跳轉時報錯,錯誤如下: java.lang.NoSuchMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servl

在ubuntu10.04下搭建tftp伺服器的血淚史(完美解決本機測試tftp localhost出現tansfer:timed out)

        TFTP from server 192.168.0.22; our IP address is 192.168.0.25         Filename 'zImage'.         Load address: 0x30008000         Loading: T T T T

Navicat for MySQL破解,以及連線資料庫出現錯誤1045-Access denied for user 'root'@'localhost'解決方法

好久沒動自己windows電腦上的mysql資料庫了,今天用的時候發現navcat到期了,網上找了一個破解檔案,挺好用,分享一下: 連結: https://pan.baidu.com/s/1slwQxVB 密碼: r737 我navcat的版本: 然而連線資料庫

訪問wamp的localhost出現“沒有許可權訪問”解決方法

Forbidden You don't have permission to access/on this server. 解決如下: 1.開啟http.conf檔案 2.找到 <Directory "E:/wamp/www/">     ........

tomcat管理頁面403 Access Denied的解決方法

安裝tomcat,配置好tomcat環境變數以後,訪問manager app頁面,出現403 Access Denied錯誤,解決的方法如下: 首先在conf/tomcat-users.xml檔案裡面,在</tomcat-users>前面新增如下程式碼: <

android訪問靜態頁面出現405異常解決辦法

訪問服務使器URL用IE瀏覽器可以下載,但是用客戶端測試就沒辦法,提示網路錯誤,在客戶端那邊,得到的結果就是405錯誤,這個是nginx返回的。於是,在我的電腦上拿瀏覽器,輸入制定的url,那客戶端模擬器都可以開啟,於是查看了日誌,發現了其中的不同。瀏覽器是用傳送的GET請求,而客戶端是傳送的POST請求。

解決MySQL 報錯1045- Access denied for user 'root'@'localhost'(using password YES)

一、前言 今年瘋狂迷上了開源,只要看到好的開源專案,就會不顧一切一股腦扎進去研究,五一期間發現一個很好的關於眾籌的開源專案,但不巧,這個專案竟然是 PHP 寫的,沒學過 PHP,自然對這個開源專案毫無頭緒了,但我竟然為了這個專案,毅然決定入坑 PHP,

Troubleshoot S3 HTTP 403: Access Denied Error

Issues in the bucket policy or IAM user policies Review the bucket policy or associated IAM user policies for any state

Resolve HTTP 403 Access Denied Error From an S3 Website Endpoint Origin in Amazon CloudFront

{ "Version": "2008-10-17", "Id": "PolicyForCloudFrontPrivateContent", "Statement": [ { "Sid": "Allow-OAI-Access-

Resolve HTTP 403 Access Denied Error From an S3 REST API Endpoint Origin in Amazon CloudFront

{ "Version": "2008-10-17", "Id": "PolicyForCloudFrontPrivateContent", "Statement": [ { "Sid": "Allow-OAI-Access-

struts2下無法用直接通過路徑訪問.jsp的頁面HTTP Status 403 - Access to the requested resource has been denied

struts2下無法用直接通過路徑訪問.jsp的頁面 http://localhost:8081/struts2_020/index.jsp 訪問會出錯,   HTTP Status 403 - Access to the requested resource has be

解決微信瀏覽器訪問手機頁面訪問頁面無手機頁面,是否進一步訪問電腦版?

hash asc meta 微信瀏覽器 not ont 也會 clas split dz論壇總是報502沒辦法了,發到這裏備份。 這個問題困擾樓主很長時間了,具體原因因為不懂php沒去研究源碼,所以只能用js解決了。也就是大家常見的通過修改source\language\l

sharepoint 2013 使用Office Web Apps 查看或編輯office文檔時頁面出現“抱歉,出現了問題”錯誤

moss sharepoint officewebapp報錯 sharepoint 使用Office Web Apps 查看或編輯office文檔時頁面出現:“抱歉,出現了問題”錯誤 sharepoint 2013 使用Office Web Apps 查看或編輯office文檔時頁面出現:“抱歉,出現了

訪問RESTful接口時出現Could not write content: No serializer found for class 的問題解決小技巧收集

onu restfu zab blank rest org lips 收集 規範 註意:市面上對於寫RESTful是用RestFul,其實是不規範的,標準寫法RESTful。 在Java上,處理這個應該是沒有繼承Serializable類,然後通過Eclipse生成ser

連接MySQL數據庫出現錯誤Access denied for user 'root'@'localhost' (using password:YES)

回車 發現 using 命令行 denied sql數據庫 roo 成功 host   自己在重拾MySQL數據庫的時候,第一次連接數據庫時候出現Access denied for user ‘root‘@‘localhost‘ (using password:YES)的錯

Tomcat默認工具manager管理頁面訪問配置

tomcat manager Tomcat的默認工具manager配置,在很多的生產環境中由於基本用不到、或者是不太需要使用Tomcat默認的manager管理頁面時一般都會把Tomcat的默認webapp下的內容給刪除了,但是如果需要使用Tomcat默認的manager來管理項目時就需要保留相