For beginners-set the user name and password after installing Tomcat and how to deploy the project on the Tomcat server

Source: Internet
Author: User

After the Tomcat server is installed, first enter the user name and password for login. However, during tomcat installation, it seems that we didn't set the user name and password. At this time, some people may be crazy, some people suddenly forget their usernames and passwords. How can this problem be solved?

No worries. During tomcat installation, the user is not allowed to set the user name and password, because the user needs to write it in the configuration file. The process is as follows:

Take the directory where I installed Tomcat as An Example D: \ Program Files \ apache-Tomcat-6.0.35

Go to the directory, find the conf file, find the tomcat-users.xml file, open it with notepad



Add <User Username = "" Password = "" roles = "manager"/>

<tomcat-users><!--  NOTE:  By default, no user is included in the "manager-gui" role required  to operate the "/manager/html" web application.  If you wish to use this app,  you must define such a user - the username and password are arbitrary.--><!--  NOTE:  The sample user and role entries below are wrapped in a comment  and thus are ignored when reading this file. Do not 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="" password="" roles="manager"/> </tomcat-users>

In the above code, you can set the user name and password by yourself.

Are you aware of this?

After Tomcat is installed, how can I deploy my project to tomcat?

First, set the methods and places of Tomcat settings in myeclipse, as shown in


You do not need to set the JDK Loading Method paths.


After setting, deploy your project to the Tomcat server. You can use ide myeclipse to deploy the project, or manually deploy the project in server. xml.

Open the conf folder installed in Tomcat and find server. xml. Open the following code in it:

<Context path="/struts2" docBase="D:\MyEclipse 10 WorkSpace\struts2\WebRoot" reloadable="true" />

Specifically, struts2 is the project name. docbase is the project path reloadable, which indicates that when the configuration file is modified and other servers are automatically reloaded


In this way, start the server.

For beginners-set the user name and password after installing Tomcat and how to deploy the project on the Tomcat server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.