Installing Tomcat on Linux

Source: Internet
Author: User
Tags tomcat server

The software version used in this article is as follows:




  1. Download the installation and configuration of the JDK, and refer to the detailed steps for installing the JDK on Linux on the previous blog post.

  2. Installation of Tomcat

  3. Unzip
    # Mkdir/usr/local/tomcat
    # Cd/usr/local/tomcat
    # tar-zxvf/software/apache-tomcat-7.0.52.tar.gz
    Generate links for version upgrades
    # ln-s apache-tomcat-7.0.52 Server

    Start Tomcat
    # Cd/usr/local/tomcat/server/bin

    Test Tomcat:
    Open the firewall to allow external access
    #/sbin/iptables-i input-p TCP--dport 8080-j ACCEPT
    # Service Iptables Save
    # Service Iptables Restart

  4. Select from the configuration file to start Tomcat

    [[email protected] bin]#./
    Using catalina_base:   /usr/local/tomcat/apache-tomcat-7.0.52
    Using catalina_home:  /usr/local/tomcat/ apache-tomcat-7.0.52
    Using Catalina_tmpdir:/usr/local/tomcat/apache-tomcat-7.0.52/temp
    Using JRE_HOME:        /usr/lib/jvm/jdk1.8.0_131
    Using classpath:       /usr/local/tomcat/apache-tomcat-7.0.52/bin/bootstrap.jar:/usr/local/tomcat/apache-tomcat-7.0.52/ Bin/tomcat-juli.jar
    Tomcat started.

  5. View the IP address of this computer to see if it has been started

    [Email protected] bin]# ifconfig
    Eth0 Link encap:ethernet HWaddr 00:0c:29:e7:f5:09
    inet addr: bcast: mask:

    In the browser input:

    The page that appears Tomcat indicates that the installation was successful.

    Stop Tomcat

  6. Configuring the Web Access port
    You can modify the file Server.xml in the Conf directory, modify the connector element (the default port for Tomcat is 8080) and need to restart the Tomcat service to take effect.
    # Vi/usr/local/tomcat/server/conf/server.xml
    <connector port= "protocol=" http/1.1 "connectiontimeout=" 20000 "redirectport=" 8443 "/>

  7. Tomcat directory structure
        bin    //Command script file hosting Tomcat
        conf    // Various configuration files for the Tomcat server, most notably Server.xml
        lib    //store Tomcat Server support jar package
        Logs    //storing log files
        temp    //storing temporary files
        WebApps//web the directory in which the application resides, Directory for external access to Web resources
        work    //tomcat working directory

  8. Directory structure for Web Apps
    WebApp--The directory where the Web application resides
    |---html, JSP, CSS, JS files, etc.-these files are generally in the root directory of the Web application, the files under the root directory can be directly accessed by the outside world.
    |---web-inf directory-java classes, JAR packages, Web configuration files exist in this directory, the outside world is not directly accessible, the WEB server is responsible for the call.
    |---Classes Directory--Java class
    |---lib directory--the jar package required for Java classes to run
    |---web. xml file--configuration file

This article is from the "xinsz08の parallel space-time" blog, be sure to keep this source

Installing Tomcat on Linux

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.