We can manage tomcat through the graphical user interface, start Tomcat, and enter in the Address bar:
http://localhost:8080
You can see the Tomcat Welcome page, and clicking on the Tomcat Manager on the left will show a dialog box that requires a username and password, and when you forget the username and password when you first installed Tomcat, we can resolve this by following Fangjie:
Modify the Tomcat-users.xml file, which opens the file in the Conf directory under Tomcat's installation directory, and we can see the following information:
<tomcat-users>
<!–
Note:by default, no user is included in the ' Manager-gui ' role required
To operate the "/manager/html" Web application. If you are wish to the use of this app,
You must define such a user-the username and password are.
–>
<!–
Note:the sample user and role entries below are wrapped in a comment
And thus are ignored when reading this file. Don't forget to remove
<!.. .. > that surrounds them.
–>
<!–
<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″/>
–>
</tomcat-users>
Here we add the following sentence:
<user username= "admin" password= "admin" roles= "Admin,manager"/>
The modified file is:
<tomcat-users>
<!–
Note:by default, no user is included in the ' Manager-gui ' role required
To operate the "/manager/html" Web application. If you are wish to the use of this app,
You must define such a user-the username and password are.
–>
<!–
Note:the sample user and role entries below are wrapped in a comment
And thus are ignored when reading this file. Don't forget to remove
<!.. .. > that surrounds them.
–>
<!–
<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= "Admin,manager"/>
</tomcat-users>
Restart the Tomcat server, at which point we can log on to Tomcat's admin interface with user name admin, password Admin, so that we can remotely administer Tomcat