Install and configure windows + Tomcat

Source: Internet
Author: User
Tags apache tomcat

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.

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.