1, the understanding of the Web container &tomcat installation and configuration

Source: Internet
Author: User
Tags java web

Understanding of Web Containers

The concept of Web containers is well elaborated in the Java Web Development Practice Classic-basic article, which uses its perspective to understand the Web container:

To run a Java Web program, you must have the appropriate Web container support, because all of the dynamic page's program code is executed in the Web container, and the resulting results are delivered to the user.

The server side uses the Web service plug-in to accept the client's HTTP request and judge the user's request to determine whether it is a dynamic request or a static request. In the case of a static request, the file is obtained directly from the file system via the Web server and returned to the client browser via the HTTP protocol, and if it is a dynamic request, all content is submitted to the Web container, and the displayed results are generated dynamically by the program in this container. Finally, it is also returned through the Web server.

Installation and configuration of Tomcat

1, Tomcat installation needs to configure a java_home environment variable : "My Computer" → "Properties" → "Advanced" → "Environment variable" → "New user variable", "Variable name" is Java_home, "variable value" is the JDK installation folder (for example: "D:\ Java\jdk1.6.0_02 ").

2, Modify the port number , Conf/server.xml file, find the following content:

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

Modify the Port property value to the desired port number, as modified to a 80 port number:

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

3, Configure the virtual directory , found in the Conf/server.xml file, such as location, in the figure 142 lines add the following code:

<context path= "/mldn" docbase= "D:\mldnwebdemo"/>

Path: Represents the access virtual path name on the browser, which must be preceded by "/".

DocBase: Represents the real path address represented by this virtual path name.

1, the understanding of the Web container &tomcat installation and configuration

Related Article

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.