Learn Java-configure Tomcat

Source: Internet
Author: User

I have learned java before... however, it is only a language field, but it has not been used to configure the Java Runtime Environment (because JBuilder was used at the time, it itself had a virtual machine to run ). over the past few days, I have relived Java and solved the problem of not configuring tomcat in the past.

Configure Tomcat 5:

Work environment:

Win XP

Prerequisites:

  1. Install JDK (I installed JDK 1.4.2 _ 03 and the installation directory is C:/j2sdk1.4.2 _ 03)
  2. Install Tomcat 5 (I decompress the package installation method and decompress Tomcat 5 content to: F:/tomcat5. Because of the package installation method, the following manual configurations are required)

Method:

  1. Add system environment variables. The environment variables to be set include:

    • Classpath:.; C:/j2sdk1.4.2 _ 03/lib/tools. Jar
    • Path:(Same as the path value of the system variable); C:/j2sdk1.4.2 _ 03/bin
    • Java_home: C:/j2sdk1.4.2 _ 03
    • Tomcat_home: F:/tomcat5
  2. Start Tomcat. tomcat installation directory: F:/tomcat5/bin contains a startup. Bat command to start the Tomcat runtime service. shutdown. bat is the end service.
  3. Test site configuration. Open F:/tomcat5/CONF/server. xml and find the following content:
    ========================================================== ========================================================== ==============
    <! -- Define a non-SSL coyote HTTP/1.1 Connector on port 8080 -->
    <ConnectorPort = "8080"
    Maxthreads = "150" minsparethreads = "25" maxsparethreads = "75"
    Enablelookups = "false" redirectport = "8443" acceptcount = "100"
    DEBUG = "0" connectiontimeout = "20000"
    Disableuploadtimeout = "true"/>
    ========================================================== ========================================================== ==============
    It can be seen that connector is a Web service connection for non-ssl http 1.1 Access. The attribute port is the access port, and the other attribute is to configure some HTTP access parameters:
    ========================================================== ========================================================== ==============
    <HostName = "localhost" DEBUG = "0" appbase = "webapps"
    Unpackwars = "true" autodeploy = "true"
    Xmlvalidation = "false" xmlnamespaceaware = "false">
    ========================================================== ========================================================== ==============
    Host is the Server property of the Web application, and others are most concerned with the appbase property. It specifies the physical location of the Web application on the Web server, such as your program in C: /jsp directory, you can change the value of appbase to C:/jsp

As a result, Tomcat is configured. When running JSP/servlet (Java) web application, you only need to execute startup. BAT to run the Java Virtual Machine.

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.