linux / centos tomcat's configuration

One: Download tomcat archive

  Download the appropriate version of http://archive.apache.org/dist/tomcat/ in tomcat, you can also download the official website, but generally only the latest version, select the binary tar.gz suffix to download the file.

Two: download tomcat you see fit any directory, in this case is placed in the / usr directory,

  cd / usr / --- Change directory

  mkdir tomcat --- New Directory

  scp /usr/local/src/apache-tomcat-6.0.45.tar.gz /usr/tomcat/apache-tomcat-6.0.45.tar.gz - tomcat will be copied to the new directory

Three: Unzip the file

  tar -zxvf apache-tomcat-6.0.45.tar.gz

Four: After configuring the environment variables and memory settings, enter tomcat bin directory, open the file by catalina.sh vi command, and adding the following configuration:

    JAVA_OPTS="-Xms512m -Xmx1024m -Xss1024K -XX:PermSize=512m -XX:MaxPermSize=1024m"
          export TOMCAT_HOME=/usr/tomcat/apache-tomcat-6.0.45
          export CATALINA_HOME=/usr/tomcat/apache-tomcat-6.0.45
          export JRE_HOME=/usr/java/jdk1.7.0_80/jre
          export JAVA_HOME=/usr/java/jdk1.7.0_80

Five: Change the port number tomcat

  Into the tomcat's conf directory, modify the server.xml file, open the file by vi commands directly input / 8080 retrieved port number location, enter the edit mode to modify, and finally enter: wq save out

Six: firewall settings

  firewall-cmd --zone = public --add-port = 8080 / tcp --permanent ------- disposed permanent    

  firewall-cmd --reload ----------- refresh settings

  firewall-cmd --zone = public --list-ports ------- check whether the configuration is successful

 

Seven: Start tomcat

  ./startup.sh start tomcat

  ./shutdown.sh closed tomcat

Guess you like

Origin www.cnblogs.com/wqk66/p/11577433.html