Tomcat is a sub-project of Apache, is also an open source project, mainly for J2EE Web containers, because it is an open source project, often used in learning and development testing
("The most frequently used Web server currently used in business is bea WebLogic). In the open source project, the famous Apache Foundation will certainly understand, website link:
Http://www.apache.org/, and the Jakarta Project mainly includes Java projects such as Tomcat, Alexanda, and interesters can see:
http://jakarta.apache.org/. Taking into account the problem of learners' machine configuration and learning costs, Tomcat is selected as our study and test J2EE environment.
The following is some basic configurations:
First, first download Tomcat from the Internet, the latest version is 5.57, the download address is:
http://apache.freeelamp.com/jakarta/tomcat-5/v5.7/bin/jakarta-tomcat-5.5.7.zip, after downloading, there is a directory in the installation directory, mainly introducing conf, Common, WebApps:
If you are waiting now, you want to experience the charm of Tomcat, copy your web to the WebApps / root directory, and then access it by browser, the default is the following format:
Http: // localhost: 8080 /
1) The WebApps folder is mainly used for web application deployment, such as you can copy your app, such as a WAR file to this directory, the container is automatically deployed.
2) CONF folder is mainly related to the relevant configuration files of the Tomcat server
3) The Common folder is mainly placed on the files of the global variable of the container. If COMMON / LIB is placed, some file packages that require a full text configuration.
Second, J2EE related deployment specification:
Generally, as a compliant web program, it will include the following folders and files: / web-inf / (mainly some private files that do not want external programs), are not allowed to access the network Folder, such as when you enter the following
Http: // localhost: 8080 / web-inf //, there will be an error.
There is a web.xml file under the web-INF folder, which is a ClassS subfolder for the current application, the resource search, etc., / wen-INF / folder, which is the application The root path (equal to the path of ClassPath), and there is a lib folder under / Wen-INF, mainly to place the package that needs to be introduced, the application imported from here to find it, followed by the global path to the container. Tomcat_home / common / lib is looking for.
The following is the basic folder:
/ Tomcat
/ Common
/ lib
/ classes
/ confed
/ WebApps
/ Root
Web.xml
/ Web-inf
/ lib
/ classes
/ Your deployment package
Web.xml
/ Web-inf
/ lib
/ classes
Third, the configuration of the container (Server.xml)
The server.xml file in the main directory / conf folder is the configuration of the web server:
Here are some common settings, HTTP port settings, found below:
ConnectionTimeout = "20000" disableuploadtimeout = "true" /> Change the 8080 port to your favorite port, such as common 80, you can use this port to access your website: Http: // localhost: 80 is the default, you can not write, other configurations, you can visit the relevant content, entry is so simple. Web.xml is some related configuration for servlet, you can refer to the specification. You can see other articles I wrote. Continue to talk about the settings of the server.xml file, Found the following: Unpackwars = "true" autodeploy = "true" Xmlvalidation = "false" xmlnamespaceaWare = "false"> .... Host> You can add a I put it in the Tomcat directory / conf / cataline / localhost, open in the browser http: // localhost / acmeweb will turn to me in E: / EclipseProject / Acmeweb program Author Blog: Http://blog.9cbs.net/jwsh1984/