After installing a new Tomcat server, there will be no user created by default to access Administrator and Manager web interfaces. After completing the installation setup Tomcat Admin and Manager user accounts and set their passwords.
You can also visit our following articles about installing Tomcat on Linux systems.
Setup Tomcat Admin & Manager Users
To create user account edit conf/tomcat-users.xml file in editor and copy below configuration inside <tomcat-users> </tomcat-users> tags.
1 2 3 4 5 6 7 8 9 10 11 | <tomcat-users> <!-- user manager can access only manager section --> <role rolename="manager-gui" /> <user username="manager" password="_SECRET_PASSWORD_" roles="manager-gui" /> <!-- user admin can access manager and admin section both --> <role rolename="admin-gui" /> <user username="admin" password="_SECRET_PASSWORD_" roles="manager-gui,admin-gui" /> </tomcat-users> |
As per above configuration user manager only can access manager web interface but admin can access both admin + manager web interface.
After making above change Stop and Start your Tomcat server.
Access Roles in Tomcat
Tomcat 7 and onward releases uses the following roles for accessing Tomcat Admin and Manager interfaces. Use the following roles while creating users with specific access levels.
Roles for Admin (Host Manager) Access:
admin-gui – This allows access to the HTML GUIadmin-script – This allows access to the text interface
Roles for Manager (Manager App) Access:
manager-gui – This allows HTML GUI and the status pagesmanager-script – This allows text interface and the status pagesmanager-jmx – This allows JMX proxy and the status pagesmanager-status – This allows access to the status pages only
3 Comments
Awesome, you saved my day
Thanks Buddy… It was helpful
Thanks for the article…