A. Environmental preparation
JDK version: 12.0.1
Second, 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. The check the newly installed JDK
java -version
Display
installation and configuration of Linux Tomcat services
-
Tomcat installation
A. Download the Tomcat installation package
Into the official website
http://tomcat.apache.org
2. Download
Linux Tomcat installation and configuration services
to install and configure Linux Tomcat services
after the download is good, uploaded to a virtual machine / usr / local
3. Extract Tomcat
Apache Tomcat---zxvf the tar 9.0.21.tar.gz
4. modify the file name tomcat9
mv apache-tomcat-9.0.21 tomcat9
5.启动Tomcat
tomcat9 CD / bin
./startup.sh
6. The firewall settings
Firewall open port 8080, added to the firewall configuration
/ sbin / iptables -I -p TCP --dport the INPUT 8080 -j ACCEPT
7. The reboot
./startup.sh
8.IP + 8080 port
Linux Tomcat installation and configuration services