3
votes

I set up Apache Tomcat/9.0.0.M4 on Amazon Linux EC2 Instance. I completed to edit conf/tomcat-users.xml like this.

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

and then, I restarted Tomcat with ./shutdown.sh and ./startup.sh I tried to log-in, but Tomcat web page never ask ID/Password of manager. It only show me this 403 error page like this.

403 Access Denied

How to find log-in message box?

2

2 Answers

7
votes

I have faced a similar problem recently. You should create the manager.xml file in order to get remote access to your manager page.

According to the documentation:

"A default Tomcat installation includes the Manager. To add an instance of the Manager web application Context to a new host install the manager.xml context configuration file in the $CATALINA_BASE/conf/[enginename]/[hostname] folder"

In my case for example, I have this path: /usr/local/tomcat/conf/Catalina/localhost

And my file has something like this:

<Context privileged="true" antiResourceLocking="false" docBase="${catalina.home}/webapps/manager">
    <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
</Context>

Remember that "^.*$" is a regular expression.

0
votes

What worked for me was to edit context.xml files in both $CATALINA_HOME/webapps/manager/META-INF and $CATALINA_HOME/webapps/host-manager/META-INF directories (assuming my ip is 1.2.3.4)

<Context antiResourceLocking="false" privileged="true" >
  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1|1.2.3.4" />
</Context>

I installed Tomcat 8.5 and I added the following to my $CATALINA_HOME/conf/tomcat-users.xml file:

<role rolename="admin-gui"/>
<role rolename="manager-gui"/>
<user username="myuser" password="mypass" roles="admin-gui,manager-gui"/>

After editing context.xml files, I can access both Tomcat Web Application Manager localhost:8080/manager/html and Tomcat Virtual Host Manager localhost:8080/host-manager/html.