Detailed steps for installing JDK and Tomcat on Linux cloud server (recommended)

Detailed steps for installing JDK and Tomcat on Linux cloud server (recommended)

Download and install JDK

  • Step 1: First download the JDK official address from the official website http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  • You need to confirm the system bit number of your computer Linux (usually 64-bit), download the Linux x86 version for 32-bit, and the Linux x64 version for 64-bit
  • Use the Linux command to query: uname -a

insert image description here

Step 2: Upload the jdk file to the cloud service. Use the Xftp tool to copy the downloaded jdk compressed package to the cloud server (create a new folder yourself. I created software in the usr directory to store the software installation package)

insert image description here

Step 3: Unzip the jdk compressed package (using linux command)

First use the cd command to reach the folder address you created in the previous step: cd /usr/software

Then use the command to decompress the jdk compressed package: tar -xvf jdk-8u65-linux-x64.tar.gz (press the tab key to automatically complete after entering jdk)

insert image description here

Use the mv jdk1.8.0_65 jdk1.8 command to rename jdk1.8.0_65 to jdk1.8 (for future management and use)

insert image description here

Step 4: Change the environment variables after decompression

Enter the Linux command: vim /etc/profile

Then press i to enter editing mode

In the profile file, move the cursor to the end and add the following command (if the above is based on my steps, the following command can be copied. If different, remember to change the folder name and jdk name):

export JAVA_HOME=/usr/software/jdk1.8 export JRE_HOME=/usr/software/jdk1.8/jre export PATH=$PATH:/usr/software/jdk1.8/bin export CLASSPATH=./:/usr/software/jdk1.8/lib:/usr/software/jdk1.8/jre/lib 

insert image description here

After completion, press Esc, then press: to enter the last line mode, enter the Linux command wq to save and exit

insert image description here

Step 5: Restart the Linux server

After the reboot is complete, enter the following command:

java -version

javac -version

If the following English appears, it proves that the JDK installation is successful

insert image description here

Download and install Tomcat Step 1: Download Tomcat from the official website. If JDK has been successfully installed above, install Tomcat below (similar to the JDK steps). First, go to the official website to download Tomcat: http://tomcat.apache.org/

insert image description here

Step 2: Upload the tomcat file to the cloud service. Use the Xftp tool to copy the downloaded tomcat compressed package to the cloud server.

insert image description here

Step 3: Unzip the tomcat compressed package (using the Linux command). First use the cd command to go to the folder address created in the previous step: cd /usr/software. Then use the command to unzip the jdk compressed package: tar -xvf apache-tomcat-8.0.30.tar (press the tab key to automatically complete after entering apache)

insert image description here

Step 4: Change the environment variables after decompression

Enter the Linux command: vim /etc/profile

Then press i to enter editing mode

In the profile file, move the cursor to the end and add the following command (if the above is based on my steps, the following command can be copied. If different, remember to change the folder name and jdk folder name):

export CATALINA_HOME=/usr/software/apache-tomcat-8.0 

insert image description here

After completion, press Esc, then press: to enter the last line mode, enter the Linux command wq to save and exit

insert image description here

Step 5: Change the port number

Use the Linux command to enter the configuration folder: cd /usr/software/apache-tomcat-8.0.30/conf

insert image description here

Enter vi server.xml in the Linux command and find the following code:

Change 8080 to the default port 80 of the HTTP protocol. The modified code is as follows:

insert image description here

Enter the cd /usr/local/tomcat/apache-tomcat-8.0.30/bin directory

insert image description here

Enter the cloud server console, enter the security group rules, add security group rules, and configure port 80 (if you have not changed port 80 above, the port range is 8080).

insert image description here

Step 6: Start the tomcat server

Use the Linux command to enter the bin directory of the tomcat folder: cd /usr/software/apache-tomcat-8.0.30/bin

insert image description here

Enter your own IP address in the browser (if you have not changed the port number, add :8080 after the IP address), and the Tomcat homepage appears, which proves that the Tomcat configuration has been successfully started.

If the web page is blocked, you can try to disable the Linux firewall using the following command. Command: service iptables stop

Listitem

Summarize

The above are the detailed steps for installing JDK and Tomcat on Linux cloud server introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Detailed tutorial on installing Tomcat8.5 in Centos8.2 cloud server environment
  • Alibaba Cloud Server Tomcat cannot be accessed
  • Solution to slow response of Tomcat server
  • Detailed steps for configuring Tomcat server in IDEA 2020
  • Tomcat Server Getting Started Super Detailed Tutorial

<<:  Vue project packaging, merging and compression to optimize web page response speed

>>:  MySQL 8.0.15 winx64 compression package installation and configuration method graphic tutorial

Recommend

Vue's global watermark implementation example

Table of contents 1. Create a watermark Js file 2...

Have you carefully understood Tags How it is defined How to use

Preface : Today I was asked, "Have you carefu...

Detailed explanation of various HTTP return status codes

When a request is sent to your server to display ...

Two-hour introductory Docker tutorial

Table of contents 1.0 Introduction 2.0 Docker Ins...

Implementation of Nginx forwarding matching rules

1. Regular expression matching ~ for case-sensiti...

Some functions of using tcpdump to capture packets in the Linux command line

tcpdump is a flexible and powerful packet capture...

How to publish a locally built docker image to dockerhub

Today we will introduce how to publish the local ...

Prototype and prototype chain prototype and proto details

Table of contents 1. Prototype 2. Prototype chain...

How to write the Nofollow tag and how to use it

The "nofollow" tag was proposed by Goog...

JavaScript Html to implement the mobile red envelope rain function page

This article example shares the specific code of ...

How to implement batch deletion of large amounts of data in MySQL large tables

The question is referenced from: https://www.zhih...

Detailed explanation of the installation and use of Vue-Router

Table of contents Install Basic configuration of ...

CSS3+Bezier curve to achieve scalable input search box effect

Without further ado, here are the renderings. The...

Solution to multiple 302 responses in nginx proxy (nginx Follow 302)

Proxying multiple 302s with proxy_intercept_error...