Install tomcat and deploy the website under Linux (recommended)

Install tomcat and deploy the website under Linux (recommended)

Install jdk:

Oracle official download https://www.oracle.com/technetwork/java/javase/downloads/index.html

Install openjdk with yum:

1. Find the available jdk package:

[root@linux ~]# yum list |grep jdk

2. Select the corresponding version of the package to install:

[root@linux ~]# yum -y install java-1.8.0-openjdk

Install tomcat:

Tomcat official website: http://tomcat.apache.org/
Tomcat mainstream versions: 7.0/8.5/9.0

Download the tomcat binary package:

[root@linux ~]# cd /usr/local/src/
[root@linux src]# wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-9/v9.0.27/bin/apache-tomcat-9.0.27.tar.gz

Unzip:

[root@linux src]# tar -xzvf apache-tomcat-9.0.27.tar.gz

Move to the /usr/local/ directory:

[root@linux src]# mv apache-tomcat-9.0.27 /usr/local/tomcat

Start tomcat:

[root@linux ~]# /usr/local/tomcat/bin/startup.sh 
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.

View the process:

ps -ef|grep tomcat 或ps -ef|grep java

View the listening port:

[root@linux ~]# netstat -lntp |grep java
tcp6 0 0 :::8009 :::* LISTEN 13601/java     
tcp6 0 0 :::8080 :::* LISTEN 13601/java     
tcp6 0 0 127.0.0.1:8005 :::* LISTEN 13601/java

8080: web port
8005: Management port
8009: AJP port (provided for third-party application connections)

Use zrlog to deploy the website through tomcat:

zrlog is an open source java blog system, official website: https://www.zrlog.com/

Download zrlog:

[root@linux ~]# wget http://dl.zrlog.com/release/zrlog-2.1.3-b5f0d63-release.war?attname=ROOT.war&ref=index

Move to the webapps directory of tomcat:

[root@linux ~]# mv zrlog-2.1.3-b5f0d63-release.war\?attname\=ROOT.war /usr/local/tomcat/webapps/zrlog.war

When you move the .war package to the webapps directory, it will be automatically decompressed:

[root@linux ~]# cd /usr/local/tomcat/webapps/
[root@linux webapps]# ls
docs examples host-manager manager ROOT zrlog zrlog.war

Rename the zrlog directory to ROOT:

[root@linux webapps]# mv ROOT ROOT.bak
[root@linux webapps]# mv zrlog ROOT

Create a database for the zrlog blog website:

[root@linux ~]# mysql -uroot -p123456 -e "create database zrlog"

Create a database user and authorize it:

[root@linux ~]# mysql -uroot -p123456 -e "grant all on zrlog.* to 'zrloguser'@'127.0.0.1' identified by 'test123'"

#Create user zrloguser, password test123, authorized host: 127.0.01

Access from the browser: http://ip:8080/

insert image description here

#Next step after configuring the database information

Configure administrator account information:

insert image description here

#After entering the information, click Next to complete the installation.

After logging in to the backend with an administrator account, you can make various settings:

insert image description here

Summarize

The above is my introduction to installing tomcat and deploying websites under Linux. I hope it will be helpful to you. If you have any questions, please leave me a message and I 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 explanation of how to deploy static html website in tomcat
  • How to deploy simple html static web pages with tomcat
  • HTML5 implements WebSocket connection and simple real-time chat based on Tomcat 7.0
  • Idea2020.2 Detailed explanation of how to create a JavaWeb project (deploy Tomcat)
  • Jenkins+tomcat automatic hot deployment/restart and solutions to problems encountered (recommended)
  • Detailed graphic explanation of the process of deploying the created Java web project to Tomcat in idea
  • Idea packaged into war package deployed to tomcat and access path issues (illustration and text)
  • Methods and steps for deploying multiple war packages in Tomcat
  • Analysis of the process of deploying pure HTML files in Tomcat and WebLogic

<<:  vue+rem custom carousel effect

>>:  MySQL Learning (VII): Detailed Explanation of the Implementation Principle of Innodb Storage Engine Index

Recommend

A brief discussion on the correct posture of Tomcat memory configuration

1. Background Although I have read many blogs or ...

HTML dl, dt, dd tags to create a table vs. Table creation table

Not only does it reduce the cost of website develo...

How to use partitioning to optimize MySQL data processing for billions of data

When MySQL queries tens of millions of data, most...

Several things to note when making a web page

--Homepage backup 1.txt text 2. Scan the image 3. ...

Summary of common functions and usage methods of WeChat applet development

Here, I have mainly sorted out some commonly used...

Comprehensive explanation of CocosCreator hot update

Table of contents Preface What is Hot Change Coco...

JavaScript to achieve simple tab bar switching case

This article shares the specific code for JavaScr...

Solution to the garbled problem of web pages when the encoding is set to utf-8

Recently, when I was writing web pages with PHP, I...

Mysql specifies the date range extraction method

In the process of database operation, it is inevi...

Some summary of MySQL's fuzzy query like

1. Common usage: (1) Use with % % represents a wi...

Complete steps of centos cloning linux virtual machine sharing

Preface When a Linux is fully set up, you can use...

MySQL Failover Notes: Application-Aware Design Detailed Explanation

1. Introduction As we all know, in the applicatio...

Solve the problem of MySQL Threads_running surge and slow query

Table of contents background Problem Description ...