Detailed tutorial of installing nginx on centos8 (graphic)

Nginx, pronounced "engine x", is an open source high-performance HTTP and reverse proxy server that handles the load of some of the largest sites on the Internet. It can be used as a standalone web server for HTTP and non-HTTP servers, load balancer, content caching and reverse proxy.

Compared with Apache, Nginx can handle a large number of concurrent connections, and each connection has a smaller memory footprint.

This tutorial explains how to install Nginx on CentOS 8.

NGINX official website

http://nginx.org/

Create folder mkdir nginx
Enter the created folder
Download the appropriate version according to your needs

Download the file via wget http://nginx.org/download/nginx-1.17.6.tar.gz

Install necessary plugins

yum -y install gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel

Talk about the role of these

gcc It can compile languages such as C, C++, Ada, Object C and Java

pcre pcre-devel pcre is a perl library, including a perl-compatible regular expression library. The http module of nginx uses pcre to parse regular expressions, so you need to install the pcre library

zlib zlib-devel zlib library provides a variety of compression and decompression methods nginx uses zlib to gzip the content of the http package, so it needs to be installed

openssl openssl-devel openssl is the cornerstone of web secure communication, without openssl, it can be said that our information is all running naked

Unzip the downloaded file
tar -zxvf nginx-1.17.6.tar.gz
Go to the nginx-1.17.6 folder
start installation
Specify the installation path
. /configure –prefix=/software/nginx
This sentence means to specify the installation path
–prefix=/software/nginx
Compile
make
installation
make install
Enter sbin under the directory where nginx is installed
Start command
. /nginx

Open the browser to visit your IP address, and this page shows that nginx has started successfully

Stop service gracefully

This method is milder than stop, and requires the process to complete the current work before stopping.
nginx -s quit

Stop service immediately

This method is relatively tough, and it stops the process directly regardless of whether it is working or not.
nginx -s stop

Query nginx main process number

ps -ef | grep nginx

Calmly stop kill -QUIT main process number
Quick stop kill -TERM main process number
Force stop kill -9 nginx

ps: Install Nginx on CentOS 8

Starting with CentOS 8, the Nginx package is available in the default CentOS repository.

To install Nginx on CentOS 8 simply enter the following:

After the installation is complete, use the following command to enable and start the Nginx service:

To verify that the service is running, check its status:

The output should look like this:

Adjust firewall

FirewallD is the default firewall solution on Centos 8.

During the installation process, Nginx uses predefined rules to create a firewall service file to allow access to HTTP (80) and HTTPS (443) ports.

Use the following command to permanently open the necessary ports:

Now, you can test the installation of Nginx by opening it in a web browser via http://YOUR_IP. You should see the default Nginx welcome page, which should look similar to the image below:

to sum up

The above is a detailed tutorial (graphic) for installing nginx on centos8 introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message. The editor will reply to you in time. Thank you very much for your support to the ZaLou.Cn website!
If you think this article is helpful to you, welcome to reprint, please indicate the source, thank you!

Recommended Posts

Detailed tutorial of installing nginx on centos8 (graphic)
Detailed tutorial on installing JDK8 on Linux system (CentOS7 installation)
CentOS 8 installation of MariaDB detailed tutorial
Tutorial diagram of installing CentOS 8 (1905) system on VMware virtual machine
Detailed method of installing Kernel 5.x kernel version on CentOS 8 system
Detailed tutorial on installing python3.7 for ubuntu18
Detailed tutorial for installing CUDA9.0 on Ubuntu 16.04
Detailed tutorial for installing phpMyAdmin on Ubuntu 18.04
Install nginx in centos8 custom directory (detailed tutorial)
CentOS 6.5 system installation and configuration graphic tutorial (detailed graphic)
Detailed explanation of building Hadoop environment on CentOS 6.5
The tutorial for upgrading from Centos7 to Centos8 (detailed graphic)
Detailed explanation of CentOS7 network setting tutorial in vmware
Deployment of graphite on centos7
vmware install CentOS 7 detailed tutorial
5.1. CentOS@ install JDK1.8 graphic tutorial
Install Nginx server on CentOS 7
Detailed explanation of Spark installation and configuration tutorial under centOS7
Centos8 minimal deployment and installation of OpenStack Ussuri detailed tutorial
Centos7 installation of Dameng database tutorial
CentOS8.1 build Gitlab server detailed tutorial
Detailed use of nmcli in CentOS8
CentOS6 minimal installation KVM detailed tutorial
How to install Nginx on CentOS 8
Centos8 installation diagram (super detailed tutorial)
Detailed examples of Centos6 network configuration
Build Nginx environment on Linux (CentOS)
Tutorial diagram for installing zabbix2.4 under centos6.5
CentOS 7 system installation and configuration graphic tutorial
Configure Nginx reverse proxy based on CentOS 7
Configure Nginx load balancing based on CentOS 7
Concise summary of Ceph deployment on Centos7
Centos 7 64-bit desktop version installation graphic tutorial
[Graphic] How to install tomcat on centos
Graphical tutorial for installing JDK1.8 under CentOS7.4
Centos7 installation and deployment of Airflow detailed
[Centos8] The bumpy process of installing docker
Windows10 install ubuntu20.04 dual system detailed graphic tutorial
Build Nginx based on Centos 7 (including virtual host)
Some basic optimizations of Centos6.9 system (updated on 2018/04/19)
Solve the problem of installing VMwareTools on Ubuntu 18.04
CentOS8 detailed tutorial for configuring local yum source
Errors and solutions for installing remix-ide on CentOS
Configure Nginx to start automatically based on CentOS 7
Notes on installing pptp server under CentOS 7 ok
Build LEMP (Linux+Nginx+MySQL+PHP) environment under CentOS 8.1 (detailed tutorial)
Detailed explanation of data types based on Python
CentOS7 Docker Nginx deployment and operation detailed explanation
The latest method of installing Mongodb on Ubuntu 16.04
Solve the problem of installing Theano on Ubuntu19
MySQL 8.0 installation, deployment and configuration tutorial on CentOS 8
Centos7.3 install nginx
Centos7 install Nginx
Detailed explanation of Centos 7 system virtual machine bridging mode
Centos8 (minimal installation) a new installation of Python3.8+pip method tutorial
Detailed explanation of the remaining problem based on python (%)
Detailed installation steps of CentOS6.4 system in virtual machine
Detailed steps to install centos on vmware10.0 cracked version
Equal Insurance Evaluation: Detailed Explanation of Centos Timeout Exit
How to use Let's Encrypt to protect Nginx on CentOS 8