Tomcat environment (web basic learning Note 1) and tomcat learning notes

Source: Internet
Author: User

Tomcat environment (web basic learning Note 1) and tomcat learning notes

 

1. download and install the Tomcat server

Download Tomcat installation package: http://tomcat.apache.org/

 

Click Download To Go To The Download page, as shown in.

2. Click the version to be downloaded on the left and select atat7.0 or another version.

3. Select the file type to download,

4. Decompress or install the package.

 

5. Click tomcatx.exe in the binfile of the installation unzip directory or click startup. bat to start tomcat.

6. Open the browser and enter http: // localhost: 8080. If you can call the tomcat URL, it indicates that it has been started, as shown in figure

FAQs about Tomcat startup:

The Tomcat server cannot be started normally because of the following two reasons:

1. JAVA_HOME environment variable settings

Double-click startup in the bin directory. when the bat file starts the Tomcat server, the first thing to do is to set the JAVA_HOME environment variable in windows, because the JAVA_HOME environment variable is required for Tomcat server startup. If the JAVA_HOME environment variable does not exist in windows, the Tomcat server cannot be started. Configure Environment Variables

 

JAVA_HOME indicates the JDK installation path, and then write the JDK installation path in the variable value. For example, the variable value set here is"D: \ Program Files (x86) \ Java \ jdk1.7.0", After setting the variable value, click OK. The JAVA_HOME environment variable is set, as shown in figure: A" JAVA_HOME "variable is added to the system variable.

 

2. Port occupation Problems

The Tomcat server needs to use port 8080 by default during startup. If port 8080 is occupied by other applications, the Tomcat server cannot be started normally, as shown in: "The Tomcat server startup interface prints An Exception error message and closes it automatically:

Change the port number to install or unzip the directory, find conf \ server. xml, and open the following code:

 <Connector port="8080" protocol="HTTP/1.1"               connectionTimeout="20000"               redirectPort="8443" />

Change 8080 to the required port, such as port 80.

 

Close tomcat and restart. Open the browser and enter http: // localhost to test port 80. You do not need to enter port 80 or specify port http: // localhost: xxxx by default.

 

Change the virtual directory:

6. Modify the web. xml file in the conf directory and find

<Init-param> <param-name> listings </param-name> <param-value> false </param-value> </init-param> change false to true, save and restart tomcat,

 

7. http: // localhost/test

Configure Tomcat in eclipse

Eclipse download http://www.eclipse.org/downloads/download.php? File =/technology/epp/downloads/release/indigo/SR2/eclipse-jee-indigo-SR2-win32.zip

Test:

Test in file-new-dynamic web project

Click new server wizard in the servers below to add the tomcat server. Next, add the project

 

 

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.