Home Operation and Maintenance Nginx Centos8 installation nginx instance analysis

Centos8 installation nginx instance analysis

May 24, 2023 pm 03:34 PM
centos nginx

nginx official website

Create foldermkdir nginx<br>Enter the created folder
Download the appropriate version according to your needs

Centos8 installation nginx instance analysis

Download the file through wget

Install the necessary plug-ins

yum -y install gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel
Copy after login

Let’s talk about the functions of these

gcc It can be compiled c, c, ada, object c and java and other languages

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 Need to install the pcre library

zlib zlib-devel The zlib library provides many compression and decompression methods nginx uses zlib to gzip the contents of the http package, so you need to install

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

Unzip the downloaded file
tar -zxvf nginx-1.17.6.tar.gz
Go to the nginx-1.17.6 folder
Start the installation
Specify the installation path
./configure --prefix=/software/nginx
This sentence means specifying 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 access your IP address, display this page to indicate that nginx started successfully

Centos8 installation nginx instance analysis

Stop the service calmly

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

Stop the service immediately

This method is tougher, regardless of whether the process is working or not. Stop the process directly.
nginx -s stop

Query nginx main process number

ps -ef | grep nginx

Stop calmly kill -quit main process number
Quickly stop kill -term main process number
Force stop kill -9 nginx

ps: in Install nginx on centos 8

Starting from centos 8, nginx packages are available in the default centos repository.

To install nginx on centos 8, just enter the following:

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

To verify whether the service is running Run, please check its status:

The output should look like this:

Adjust the firewall

firewalld is the default firewall solution on centos 8.

During the installation process, nginx creates a firewall service file using predefined rules 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 nginx installation by opening http://your_ip in a web browser. You should see the default nginx welcome page, which should look similar to the image below:

Centos8 installation nginx instance analysis

The above is the detailed content of Centos8 installation nginx instance analysis. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to allow external network access to tomcat server How to allow external network access to tomcat server Apr 21, 2024 am 07:22 AM

How to allow external network access to tomcat server

SCP usage tips-recursively exclude files SCP usage tips-recursively exclude files Apr 22, 2024 am 09:04 AM

SCP usage tips-recursively exclude files

How to run thinkphp How to run thinkphp Apr 09, 2024 pm 05:39 PM

How to run thinkphp

Welcome to nginx!How to solve it? Welcome to nginx!How to solve it? Apr 17, 2024 am 05:12 AM

Welcome to nginx!How to solve it?

How to deploy nodejs project to server How to deploy nodejs project to server Apr 21, 2024 am 04:40 AM

How to deploy nodejs project to server

How to generate URL from html file How to generate URL from html file Apr 21, 2024 pm 12:57 PM

How to generate URL from html file

How to open the linux terminal shortcut key How to open the linux terminal shortcut key Apr 11, 2024 pm 06:33 PM

How to open the linux terminal shortcut key

What are the classifications of linux systems? What are the classifications of linux systems? Apr 12, 2024 pm 02:15 PM

What are the classifications of linux systems?

See all articles