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 backend management system implementation of paging function example

This article mainly introduces the implementation...

HTML table markup tutorial (16): title horizontal alignment attribute ALIGN

By default, the table title is horizontally cente...

A brief analysis of the responsiveness principle and differences of Vue2.0/3.0

Preface Since vue3.0 was officially launched, man...

MySQL 5.7.18 zip version installation tutorial

The mysql 5.7.18 zip version of MySQL is not like...

Summary of methods for cleaning Mysql general_log

Method 1: SET GLOBAL general_log = 'OFF';...

How to install git on linux

1. Introduction Git is a free, open source distri...

Detailed explanation of MYSQL database table structure optimization method

This article uses an example to illustrate the me...

CSS3 flip card number sample code

I received a task from the company today, and the...

JavaScript - Using slots in Vue: slot

Table of contents Using slots in Vue: slot Scoped...

Getting Started Tutorial for Beginners: Domain Name Resolution and Binding

So after registering a domain name and purchasing...

mysql group_concat method example to write group fields into one row

This article uses an example to describe how to u...

Linux uses iptables to limit multiple IPs from accessing your server

Preface In the Linux kernel, netfilter is a subsy...

mysql5.7 remote access settings

Setting up remote access in mysql5.7 is not like ...

Detailed explanation of nginx shared memory mechanism

Nginx's shared memory is one of the main reas...