Installing Tomcat on Linux

Source: Internet
Author: User
Tags tomcat server

The software version used in this article is as follows:

linux:centos6.7

tomcat:tomcat-7.0.52

Jdk:jkd-8u131-linux-x64


  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 startup.sh from the configuration file to start Tomcat

    [[email protected] bin]#./startup.sh
    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:192.168.1.104 bcast:192.168.1.255 mask:255.255.255.0



    In the browser input: http://192.168.1.104:8080

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


    Stop Tomcat
    #./shutdown.sh


  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 http://xinsz08.blog.51cto.com/10565212/1949149

Installing Tomcat on Linux

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.