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 compile and install Nginx

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

In this article, the editor introduces in detail "how to compile and install Nginx". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to compile and install Nginx" can help you solve your doubts.

Download the nginx source file

Go to the nginx website to download the stable version of nginx. I downloaded 1.10.0.

Decompress: tar-zxvf nginx-1.10.0.tar.gz

Check installation dependencies

Execute the following command to install the dependent libraries for nginx:

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

Configure nginx installation options

Here I only configure to install to the / opt directory, other options can be performed. / configuration-help view.

Cd nginx installation directory, execute the following command:

. / configure-prefix=/opt/nginx-sbin-path=/usr/bin/nginx

Description of parameters configuration on official website:

IV. Compile and install

Make & & make install

Start, stop and restart

# 1. Start nginxshell > nginx# via ps-ef | grep nginx to check whether nginx has been started successfully # 2. Stop nginxshell > nginx-s stop# 3. Restart shell > nginx-s reload

After the nginx default configuration starts successfully, there will be two processes, a main process (daemon) and a worker process. The main process is responsible for managing the worker process, and the worker process is responsible for handling the user's http requests.

6. Configure nginx to boot

The / usr/bin/nginx command is added to the / etc/rc.d/rc.local file, and the rc.local file is executed when the system boots. However, centos7 recommends that the boot service be written as a service description file to add to the system service, so rc.local does not have execution permission by default, so you need to add execution permission to it.

Shell > vim / etc/rc.d/rc.local# add the following parameters / usr/bin/nginxshell > chmod + x / etc/rc.d/rc.local read here, this "how to compile and install Nginx" article has been introduced, want to master the knowledge of this article also need to practice and use to understand, if you want to know more related articles, 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

Internet Technology

Wechat

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

12
Report