16.1 Introduction to Tomcat 16.2 Install jdk 16.3 Install Tomcat

Introduction to Tomcat

Tomcat is a core project in the Jakarta project of the Apache Software Foundation, developed jointly by Apache, Sun and some other companies and individuals.

 The website written by the java program uses tomcat+jdk to run

 Tomcat is a middleware that really works, and it is jdk that parses the java script

 JDK (java development kit) is the core of the entire java. It contains the java runtime environment, a bunch of java-related tools and java basic libraries.

 The most mainstream jdk is the jdk released by sun company. In addition, IBM has also released JDK. You can also use yum to install openjdk on CentOS.

 

install jdk

jdk version 1.6, 1.7, 1.8

 Official website download address http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

 Download jdk8 and put it in the /usr/local/src/ directory

cd /usr/local/src/

 tar zxvf jdk-8u151-linux-x64.tar.gz

 mv jdk1.8.0_151 /usr/local/jdk1.8

 vi /etc/profile //Add at the end

JAVA_HOME=/usr/local/jdk1.8/

JAVA_BIN=/usr/local/jdk1.8/bin

JRE_HOME=/usr/local/jdk1.8/jre

PATH=$PATH:/usr/local/jdk1.8/bin:/usr/local/jdk1.8/jre/bin

CLASSPATH=/usr/local/jdk1.8/jre/lib:/usr/local/jdk1.8/lib:/usr/local/jdk1.8/jre/lib/charsets.ja

[root @localhost src]# source /etc/profile // After saving the file, make it effective

[root @localhost src]# java -version // Check whether the settings are correct

java version "1.8.0_151"

Java(TM) SE Runtime Environment (build 1.8.0_151-b12)

Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

 

install tomcat

cd /usr/local/src

wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.24/bin/apache-tomcat-8.5.24.tar.gz

 tar zxvf apache-tomcat-8.5.24.tar.gz

 mv apache-tomcat-8.5.24 /usr/local/tomcat

 /usr/local/tomcat/bin/startup.sh

(/usr/local/tomcat/bin/shutdown.sh)

 ps aux|grep tomcat

 netstat -lntp | grep java

 The three ports 8080 are the ports for providing web services, 8005 is the management port, and port 8009 is the port for third-party service calls. For example, it will be used when httpd and Tomcat are combined.

 

iptables -nvL

[root@localhost src]# systemctl stop firewalld

[root@localhost src]# systemctl disable firewalld

Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.

Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

http://192.168.174.128:8080/

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327082724&siteId=291194637