Some details of tomcat6.0 configuration (later thought to add)

Source: Internet
Author: User

Recently learned Tomcat, found that a lot of configuration, is very cumbersome, simply write to strengthen the memory, later forget can also turn over, have not understand the friend Hope also can find corresponding solution.

Okay, the text begins.

To say is Tomcat's zip version, the installation version is omitted. I'm using the 6.0 version now.

1. Login user problem. The logged-on user can be configured in the Tomcat-users.xml file in the tomcat/conf directory. Open to see the following markup content.

<?xml   version= ' 1.0 '   encoding= ' utf-8 '?>     
<tomcat-users>     
         <role   rolename= ' Tomcat "/>     
         <role   rolename=" role1/> <role   "manager" Rolename=     
         />   rolename= "admin"/>     
         <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= ""   roles= "Admin,manager"/>     

You can see two kinds of tags, one is role tag roles, one is user tag. The user role has two types of admin and manager. When configured, you can set a role name on the above, and then set the username username and password password in the role user tag below, and then set a different role name name for the corresponding user name, separated by commas. The user name and password of Tomcat logged in by the user are set through the above procedure.

2. Server root directory settings.

As long as the specified folder is under the root directory of Tomcat settings, and there is a Web-info folder underneath the file that has a web.xml file, it can be set by Tomcat as the server root directory.

There is a way to set up the engine in the Tomcat/webapp directory. Think it's a bit of a hassle, don't mention it. Just tell a simpler one.

Depending on the conditions above that are set to the server root, you can set it in the Tomcat configuration file. The Server.xml file under the tomcat/conf directory.

After opening, there are some properties such as the configuration of Tomcat ports. Locate the host label. As above.

Then join the host under the label

<context path= "/server root directory name L" reloadable= "true" docbase= "file to be set as root" debug= "0"/>

The name behind the path is this file mapped to the server root name on Tomcat reloadable indicates whether the server is automatically overloaded after the Web page has been updated.

3. Log in.

After the above two configuration is finished, you can log in.

<connector port= "8081" protocol= "http/1.1" connectiontimeout= "20000" 
               redirectport= "8443"/>

Or find a similar tag in the Server.xml file. The 8081 behind the port is the port number that Tomcat will use. Of course you can also set the other port number.

In the Address bar type: http://localhost:8081/can be logged in.

LocalHost can also be set to Tomcat for IP logons to other users.

Open the Manager tab, type the username and password set in the first step login to the server control interface, which has a server root that we set in the second step, where I set the HTML to display, and then you can access the URL of the specified file under the server root of the setting. For example, I created a demo file under the root directory and created a test.html file below. Address bar type: http://localhost:8081/html/demo/test.html can access the specified Web page.


Here the Tomcat configuration is basically done.


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.