Setup Tomcat

Apache Tomcat is an open source web server and servlet container developed by the Apache Software Foundation (ASF)

A. Install tomcat by yum

  1. Install tomcat

    sudo yum -y install tomcat6 tomcat6-webapps tomcat6-admin-webapps
    sudo yum -y install tomcat tomcat-webapps tomcat-admin-webapps
  2. Configure tomcat as service

    sudo /sbin/chkconfig tomcat6 on
    sudo /sbin/chkconfig tomcat on
  3. Start, stop and restart tomcat

    sudo /sbin/service tomcat6 start
    sudo /sbin/service tomcat6 stop
    sudo /sbin/service tomcat6 restart
    sudo /sbin/service tomcat start
    sudo /sbin/service tomcat stop
    sudo /sbin/service tomcat restart
  4. Default tomcat's webapps Location


B. Install tomcat by manual

  1. Download and extract tomcat

    cd /tmp
    tar xzf apache-tomcat-7.0.62.tar.gz
    mv apache-tomcat-7.0.62 /usr/local/tomcat7
  2. Start and stop tomcat

    cd /usr/local/tomcat7
  3. Configure tomcat as service

    cd /etc/init.d
    vi tomcat
    # description: Tomcat Start Stop Restart
    # processname: tomcat
    # chkconfig: 234 20 80
    case $1 in
    sh $CATALINA_HOME/bin/
    sh $CATALINA_HOME/bin/
    sh $CATALINA_HOME/bin/
    sh $CATALINA_HOME/bin/
    exit 0
    chmod 755 tomcat
    chkconfig --add tomcat
    chkconfig tomcat on


Popular posts from this blog