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

ie filter collection

IE gave us a headache in the early stages of deve...

Basic usage of @Font-face and how to make it compatible with all browsers

@Font-face basic introduction: @font-face is a CSS...

How to connect to docker server using ssh

When I first came into contact with docker, I was...

Detailed explanation of Vue filter implementation and application scenarios

1. Brief Introduction Vue.js allows you to define...

CentOS 7.x deployment of master and slave DNS servers

1. Preparation Example: Two machines: 192.168.219...

Solution to overflow of html table

If the table is wide, it may overflow. For exampl...

Using JS to determine the existence of elements in an array in ten minutes

Preface In front-end development, you often need ...

MySQL 8.0.22 installation and configuration graphic tutorial

MySQL8.0.22 installation and configuration (super...

Swiper.js plugin makes it super easy to implement carousel images

Swiper is a sliding special effects plug-in built...

JavaScript operation elements teach you how to change the page content style

Table of contents 1. Operation elements 1.1. Chan...

Nginx rush purchase current limiting configuration implementation analysis

Due to business needs, there are often rush purch...

Implementation of docker-compose deployment project based on MySQL8

1. First, create the corresponding folder accordi...