Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

403 access denied on tomcat 7.0.42

I am having error 403 access denied on tomcat 7.0.42 while accessing Tomcat Manager App.

This is what I have in tomcat-user.xml file. I have tried changing roles over and over but did not work.

Note: - I start/stop tomcat from NetBeans 7.3.1

<?xml version="1.0" encoding="UTF-8"?>
<tomcat-users>
 <role rolename="manager-script"/>
<user username="admin" password="admin" roles="manager-script" />
</tomcat-users>
like image 737
Umair Ayub Avatar asked Oct 11 '13 19:10

Umair Ayub


2 Answers

Though the answer is already the correct answer, I think maybe someone will be confused about the usage of "manager-script".

The "manager-script" is for accessing the Tomcat Manager API without using Web pages.

For instance, the command below is for requesting undeploy function instead of clicking the undeploy button on Tomcat Manager web app.

curl http://localhost:8080/manager/text/undeploy?path=/app_name
like image 146
Kai Kuma Avatar answered Oct 05 '22 06:10

Kai Kuma


Remove the manager-script and add "manager-gui,manager-status".

To access the HTML interface, you need to have the manager-gui role, but you must NOT have the manager-script or manager-jmx roles.

<tomcat-users>
  <role rolename="manager-script"/>
  <role rolename="manager-gui"/>
  <role rolename="manager-jmx"/>
  <role rolename="manager-status"/>
  <user username="tomcat" password="tomcat" roles="manager-gui,manager-status"/>
</tomcat-users>

some information for you about roles from http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html

  • manager-gui — Access to the HTML interface.
  • manager-status — Access to the "Server Status" page only.
  • manager-script — Access to the tools-friendly plain text interface that is described in this document, and to the "Server Status" page.
  • manager-jmx — Access to JMX proxy interface and to the "Server Status" page.
like image 22
grepit Avatar answered Oct 05 '22 07:10

grepit