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