1. Download Apache-Tomcat-7.0.22-Windows-x86
2. Unzip the package to the target directory to complete installation.
3. test whether the installation is successful:
(1) Go to the bin directory of tomcat in the console and enter startup. BAT to start Tomcat.
(2) The default Tomcat port is 8080. Therefore, enter http: // localhost: 8080 in the browser. If Apache Tomcat is displayed, the installation and startup are successful.
To modify the port, you can find the following code in Tomcat/CONF/server. xml:
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
You can simply change it.
4. Create a site
The webapp directory is the default path for storing the site. If you want to have an http: // localhost: 8080/demo/hello. JSP can be accessed, you can create a demo directory under webapp and create a hello. JSP file. The details are as follows:
(1) directory structure
Webapp/
+-Demo/: JS, html
+-Web-inf: XML
+-Classes: Servlet
-Lib: jar
5. virtual working directory (you can use it if needed. The directory structure is the same as described in 4)
Create a yourname. xml file under/CONF/Catalina/localhost and write the following:
<Context docBase="E:\Web\myapp" reloadable="true" />
6. If the file name is not specified in the URL, whether to list all the files in the relevant directory.
In/CONF/Web. XML, find:
<init-param> <param-name>listings</param-name> <param-value>false</param-value></init-param>
Change "false" to "true.