Linux centOS installation JDK and Tomcat tutorial

Linux centOS installation JDK and Tomcat tutorial

First download JDK.

Here we use jdk-8u181-linux-x64.tar.gz

Download Tomcat.

Here we use apache-tomcat-8.5.35.tar.gz

Create a Directory

$ cd /
$ mkdir soft
$ cd soft

Put the installation package in soft

You can use the yum command to upload

Install

yum install -y lrzsz

rz Enter to select the file

Install JDK

$ cd /usr
$ mkdir java
$ tar -zxvf jdk-8u181-linux-x64.tar.gz -C /usr/java

After the installation is complete, add the environment variables

$ vim /etc/profile

Add the environment variables at the end

export JAVA_HOME=/usr/java/jdk1.8.0_181
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin

Save and exit

$wq

Then execute the command to make the environment variable take effect

$ source /etc/profile

Check whether the configuration is successful

$ java -version 

Install tomcat

$ cd /usr
$ mkdir tomcat
$ tar -zxvf apache-tomcat-8.5.35.tar.gz -C /usr/tomcat

After successful decompression, configure the firewall policy and open the firewall port 8080

$ vim /etc/sysconfig/iptables

If there is no iptables file but iptables-config

Execute the following command

$ iptables -P OUTPUT ACCEPT 
$ service iptables save
$ vim /etc/sysconfig/iptables

Add at the end

# Open port 8080 -A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

Save and exit

$wq

Modify the tomcat configuration and change the local localhost to your own domain name or server IP. Here we use IP

$ vim /usr/tomcat/apache-tomcat-8.5.35/conf/server.xml

Save and exit after modification

Start tomcat

$ sh /usr/tomcat/apache-tomcat-8.5.35/bin/startup.sh

After successful startup

Enter the server IP in the browser: 8080

Jump to the tomcat page and the configuration is successful.

END.

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links

You may also be interested in:
  • Detailed tutorial on installing CentOS, JDK and Hadoop on VirtualBox
  • Linux system (Centos6.5 and above) installation jdk tutorial analysis
  • Graphical tutorial on installing JDK1.8 under CentOS7.4
  • Install JDK8 in rpm mode on CentOS7
  • Detailed tutorial on installing JDK8 on Linux system (CentOS7 installation)
  • CentOS8 installation tutorial of jdk8 / java8 (recommended)
  • Tutorial on deploying jdk and tomcat on centos7 without interface
  • Centos installation jdk case explanation

<<:  Two ways to use react in React html

>>:  How to install MySQL using yum on Centos7 and achieve remote connection

Recommend

Vue implements scroll loading table

Table of contents Achieve results Rolling load kn...

WeChat applet implements sorting function based on date and time

I recently took over a small program project, and...

A brief discussion on CSS cascading mechanism

Why does CSS have a cascading mechanism? Because ...

In-depth analysis of HTML semantics and its related front-end frameworks

About semantics Semantics is the study of the rel...

A super detailed Vue-Router step-by-step tutorial

Table of contents 1. router-view 2. router-link 3...

How to find the specified content of a large file in Linux

Think big and small, then redirect. Sometimes Lin...

How to submit the value of a disabled form field in a form Example code

If a form field in a form is set to disabled, the ...

Text mode in IE! Introduction to the role of DOCTYPE

After solving the form auto-fill problem discussed...

Seven solutions for classic distributed transactions between MySQL and Golan

Table of contents 1. Basic theory 1.1 Transaction...

Understanding of the synchronous or asynchronous problem of setState in React

Table of contents 1. Is setState synchronous? asy...

Detailed explanation of JavaScript function introduction

Table of contents Function Introduction function ...

How to use JavaScript strategy pattern to validate forms

Table of contents Overview Form validation withou...