Linux Tomcat installation and configuration services

Before installing tomcat must first install and configure Java JDK corresponding environment


A. Environmental preparation

   JDK版本:12.0.1

II. Check the JDK version of the system

1. Enter the command: java -version

        显示

Linux Tomcat installation and configuration services

2. Check the installation package JDK

        输入命令:rpm -qa | grep java

        显示  

Linux Tomcat installation and configuration services

3. Uninstall openjdk

Linux Tomcat installation and configuration services

      或者使用命令:yum remove *openjdk*

III. Install the new JDK

1. Create a directory java jdk installation directory under / usr / directory

    mkdir  /usr/local/java

2. Use wget to download the installation package

     wget  https://download.oracle.com/otn-pub/java/jdk/12.0.1
        +12/69cfe15208a647278a19ef0990eea691/jdk-12.0.1_
        linux-x64_bin.tar.gz

     会发现报错,是因为在Oracle官网上下载jdk,需要点击
         accept licence的才能下载,所以要输下面的命令:

         wget --no-check-certificate --no-cookies --header 
         "Cookie:oraclelicense=accept-securebackup-cookie" 
         https://download.oracle.com/otn-pub/java/jdk/12.0.1+
         12/69cfe15208a647278a19ef0990eea691/jdk-12.0.1_
         linux-x64_bin.tar.gz

          注意 : 记住需要加上:--no-check-certificate --no-cookies
            --header "Cookie: oraclelicense=accept-securebackup
            -cookie"    这段是为了避开用户验证用的

3. Extract the installation package

     tar -zxvf jdk-12.0.1_linux-x64_bin.tar.gz

4. Configure Environment Variables

    vim /etc/profle

Linux Tomcat installation and configuration services

5. Execute the Profile file

  source /etc/profile

6. Check the newly installed JDK

  java -version

  显示

Linux Tomcat installation and configuration services

-

Tomcat installation


A. Download the Tomcat installation package

  1. Into the official website

    http://tomcat.apache.org

2. Download

Linux Tomcat installation and configuration services
Linux Tomcat installation and configuration services
After good download, upload virtual machines to / usr / local

3. Extract Tomcat

  tar -zxvf apache-tomcat-9.0.21.tar.gz

4. Modify the file named tomcat9

 mv apache-tomcat-9.0.21 tomcat9

5. Start Tomcat

 cd tomcat9/bin
 ./startup.sh

6. Set up a firewall

防火墙开放8080端口,增加到防火墙配置中
/sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT

7. Restart

./startup.sh 

8.IP + 8080 port

Linux Tomcat installation and configuration services

Guess you like

Origin blog.51cto.com/14359196/2412967