Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install nginx in centos8

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "centos8 how to install nginx", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "centos8 how to install nginx" this article.

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

Compared with Apache, Nginx can handle a large number of concurrent connections and takes up less memory per connection.

This tutorial explains how to install Nginx on CentOS 8.

NGINX official website

Http://nginx.org/

Create a folder mkdir nginx

Enter the folder you created

Download the appropriate version according to your own needs

Download files through wget http://nginx.org/download/nginx-1.17.6.tar.gz

Install the necessary plug-ins

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

Tell me about the functions of these.

Gcc it can compile languages such as C, Magi, C, Ada, and Java, etc.

Pcre pcre-devel pcre is a perl library, including a perl-compatible regular expression library. Nginx's http module uses pcre to parse regular expressions, so you need to install the pcrelibrary.

The zlib zlib-devel zlib library provides a variety of 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.

Extract the downloaded file

Tar-zxvf nginx-1.17.6.tar.gz

Go to the nginx-1.17.6 folder

Start installation

Specify installation path

. / configure-- prefix=/software/nginx

This sentence means to specify the installation path

-- prefix=/software/nginx

Compile

Make

Installation

Make install

Go to the sbin under the installation nginx directory

Start command

. / nginx

Open a browser to visit your IP address and display this page to show that nginx started successfully

Stop the service calmly

This approach is milder than stop and requires the process to stop after the current work is done.

Nginx-s quit

Stop the service immediately

This approach is tough and stops the process directly, whether the process is working or not.

Nginx-s stop

Query nginx main process number

Ps-ef | grep nginx

Stop the kill-QUIT main process number calmly

Quick stop kill-TERM main process number

Forcibly 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 the firewall

FirewallD is the default firewall solution on Centos 8.

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

Permanently open the necessary ports using the following command:

You can now test the installation of Nginx in a Web browser through http://YOUR_IP. You should see the default Nginx welcome page, which should look similar to the following figure:

The above is all the contents of the article "how to install nginx in centos8". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report