I. Green version of tomcat 5.5.20
The first sentence does not contain quotation marks.
Set CATALINA_HOME = C: \ Program Files \ Apache Software Foundation \ apache-tomcat-5.5.20
Second sentence
Call "C: \ Program Files \ Apache Software Foundation \ apache-tomcat-5.5.20 \ bin \ service. bat" install tomcat5
Run the following two statements in dos:
OK
Ii. tomcat virtual path Configuration
After tomcat is installed, you only need to copy your web project to % atat_home % webapp !! In fact, there is another way to set the virtual directory, that is, to map the project directory to tomcat. In this way, repeated deployment is not required, saving time and convenience for developers.
The method is as follows:
1. Find % TOMCAT_HOME % \ conf \ server. open the xml file (that is, the related files under the tomcat installation directory) and add the following code between (Note the case sensitivity of letters !!!)
DocBase is the actual path. Here we usually write an absolute disk path. Of course, we can also write a relative path, which is relative to the webapps directory in the tomcat installation directory, generally, the virtual directory is set to separate the installation of tomcat from the project. Therefore, we recommend that you use the absolute disk path, which is in the tomcat installation directory from time to time.
The path is a virtual path and the access path. Note: "/" must be added.
We recommend that you set debug to 0 and reloadable to true.
2. test and restart the tomcat server, and enter http: // localhost: 8080/test in the browser.
3. If a 404 error occurs during the test, if the preceding configuration is correct, it may be in % atat_home % \ conf \ web. the directory displayed in the virtual path is disabled in the xml file. in the xml file, find
Code
<Servlet> <servlet-name> default </servlet-name> <servlet-class> org. apache. catalina. servlets. defaultServlet </servlet-class> <init-param> <param-name> debug </param-name> <param-value> 0 </param-value> </init- param> <init-param> <param-name> listings </param-name> <param-value> false </param-value> </init-param> <load- on-startup> 1 </load-on-startup> </servlet>
Change the value of listings to true and restart tomcat. The test is successful after the url is entered!
4. If the project development is complete and you are ready to deploy it on the server, remember to put the web in step 3. change the value of the listings parameter in the xml file to false, so that the deployment path of the project cannot be displayed to the user!
The details are as follows:
<Init-param> <param-name> listings </param-name> <param-value> false </param-value> </init-param>