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

The method of recompiling and adding Modules in Nginx

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

Share

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

When compiling and installing Nginx, some modules are not installed by default, such as http_ssl_module, so you must add this module in order for Nginx to support HTTPS.

Here's how to add a new module again after it has been installed.

1. Find the root directory where the nginx is installed (that is, the directory where the installation package is stored). If not, download the new source code and decompress it.

Cd softwarelsnginx-1.10.2 nginx-1.10.2.tar.gz

2. Check the nginx version and its compilation parameters

/ usr/local/nginx/sbin/nginx-V

3. Enter the nginx source directory

Cd nginx-1.10.2

4. Recompiled code and modules

. / configure-prefix=/usr/local/nginx-with-http_ssl_module

5, execute make (note: do not make install, otherwise the installation will be overwritten), after make, there will be a nginx in the / software/nginx-1.10.2/objs directory, this is the new version of the program.

6. Back up the old nginx program

Cd / usr/local/nginx/sbin/mv nginx nginx_bak

7. Copy the new nginx program to / usr/local/nginx/sbin/

Cp / software/nginx-1.10.2/objs/nginx / usr/local/nginx/sbin/

8. Test whether the new nginx program is correct

/ usr/local/nginx/sbin/nginx-tnginx: the configuration file / usr/local/nginx/conf/nginx.conf syntax is oknginx: configuration file / usr/local/nginx/conf/nginx.conf test is successful

9. Start the service smoothly

/ usr/local/nginx/sbin/nginx-s reload

Check to see if the module is installed

/ usr/local/nginx/sbin/nginx-Vnginx version: nginx/1.10.2built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC) built with OpenSSL 1.0.1e-fips 11 Feb 2013TLS SNI support enabledconfigure arguments:-- prefix=/usr/local/nginx-- with-http_ssl_module

Restart Nginx

. / nginx-s quit./nginx

Nginx reload module completed!

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

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