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

1. Nginx source code compilation

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

You mainly rely on pcre zlib openssl when compiling Nginx, so make sure that the software has been installed

1. Compile pcre-- support regular expressions

Http://www.pcre.org/

. / configure-- prefix=/Dir/pcre-8.40/

Make & & make install

2. Compile zlib

Http://www.zlib.net/

. / configure-static-prefix=/Dir/zlib-1.2.11

Make & & make install

3. Compile openssl installation (optional)-sites that support security protocols

Http://www.openssl.org/

4. Compile nginx

Http://nginx.org/en/download.html

/ configure-- prefix=/Dir/nginx-- with-http_gzip_static_module-- with-http_stub_status_module-- with-http_ssl_module-- with-pcre=/Dir/pcre-8.40/-- with-zlib=/Dir/zlib-1.2.11

Make & & make install

Summarize the easy installation:

1. Make sure the system is equipped with pcre, pcre-devel, zlib, zlib-devel, openssl and openssl-devel.

2. Compile nginx (80)

Http://nginx.org/en/download.html

. / configure-- prefix=/Dir/nginx

Make & & make install

3. Compile nginx (443)

. / configure-prefix=/Dir/nginx-with-http_gzip_static_module-with-http_stub_status_module-with-http_ssl_module

Make & & make install

There are many modules of PS:Nginx, people who look at them are dazzled. At last, only the most basic ones are installed at the beginning of compilation, and then recompile when you need any modules, so that you can understand the role of each module in the process of operation.

5. Start nginx after the installation is complete:

/ Dir/nginx

6. Reload nginx:

/ Dir/nginx-s reload: reload takes effect after configuration modification

/ Dir/nginx-s reopen: reopen the log file

/ Dir/nginx-t: test whether the nginx configuration file is correct

7. Restart nginx smoothly:

Kill-HUP main process number

Killall-HUP nginx

8. Close nginx:

/ usr/local/webserver/nginx-s stop: quickly stop nginx

/ usr/local/webserver/nginx quit: stop nginx in a complete and orderly manner

Other ways to stop nginx:

Ps-ef | grep nginx

Kill main process number (master)

Kill-QUIT main process number: stop Nginx calmly

Kill-TERM main process number: quickly stop Nginx

Pkill-9 nginx: force stop Nginx

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