Basic configuration instructions for Tomcat5.5

xiaoxiao2021-03-06  45

Tomcat is a sub-project of Apache. It is also an open source project, mainly for J2EE Web containers, because it is an open source project, often used in learning and development test (and currently commercially used Web server is BEA WebLogic). In the open source project, the famous Apache Foundation must have aware of understanding, website link: http://www.apache.org/, and the Jakarta Project mainly includes Java projects such as Tomcat, Alexanda, interested Look: http://jakarta.apache.org/. Considering the problem of learners' machine configuration and learning costs, Tomcat is selected as our study and test J2EE's environment for some basic configuration: First, download Tomcat from the Internet, the latest version is 5.57, the download address is: http : //apache.freeeelamp.com/jakarta/tomcat-5/v5.5.7/bin/jakarta-tomcat-5.5.7.zip, after downloading, there is the following directory in the installation directory, mainly introduce 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 through the browser, the default is formatted: http: // localhost : 8080 / 1) WebAPPS folder is mainly used for web application deployment, such as you can copy your application, such as WAR files, the container will be automatically deployed. 2) Conf folder is mainly configured to place Tomcat's server. Second, J2EE's related deployment specification: Generally, as a conformity of web programs, the following folders and files are included: / web-inf / (mainly some privacy files that are placed with unwanted external programs), In the network, it is not allowed to access the 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 / class / conf / webapps / root web.xml / web-inf / lib / classes / you deploy package web.xml / web-inf / lib / classes three, Container configuration (server.xml) The server.xml file is configured to the web server: Here are some common settings, HTTP port settings, found: the 8080 port to port you prefer to use For common 80s, you can use this port to access your website: http:// localhost: 80 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 say the settings of the server.xml file, find the following: .... You can add a element, such as , where the property Path represents the context path of the network access. The reloadable represents the automatic load of the Classes with the lib folder at runtime, and the DOCBase property represents your application path in Windows, such as: docBase = "E: / Sun / AXIS ", Workdir represents the placement of cache files, which can be easily compiled when transplant cross-platform. This way, your app can be placed in any place on the hard disk.

转载请注明原文地址:https://www.9cbs.com/read-59153.html

New Post(0)