How to access Tomcat Manager from Eclipse

It has been observed that Tomcat Manager is not accessible after starting the Tomcat Server from Eclipse. Even after doing changes in file – $TOMCAT_HOME/conf/tomcat-users.xml changes are not getting reflected back.

Therefore, we need to configure Eclipse to take control over from Tomcat, we need to do double-click the Tomcat Server entry in Servers tab and then we will get the server configuration. At the left column, under Server Locations, select Use Tomcat installations (If it is grayed-out then delete the Server and add it again). This way Eclipse will take full control over Tomcat and we will be able to access the default Tomcat homepage with the Tomcat Manager when running from inside Eclipse.

Configuration to access Tomcat Manager from Eclipse
Configuration to access Tomcat Manager from Eclipse

Note: Above stated configuration is validated on Apache-Tomcat-8.0.33

How to enable Tomcat Manager

To access the Tomcat Manager page, we need to define users in file – $TOMCAT_HOME/conf/tomcat-users.xml. By default, there is NO user which means that no one can access the Tomcat Manager page.

To access the above mentioned page, we need to add a user(s) as the role “manager-gui”

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

Once done then save the file and restart the Tomcat Server and we should able to access the default manager page (http://localhost:8080/manager) with user = “admin” and password = “admin”

Note: Above stated configuration is validated on Apache-Tomcat-8.0.33