Get the App
SLTechnology News&Howtos  ›  Servers  › 

Add a new module to the already installed Nginx

Shulou Source: shulou.com Published: 2022-06-02 09:47:21 10月04日 Update

Add new modules to the existing web server to achieve richer functions. Nginx is a more commonly used web server. Nginx can not only be used as a web server, but also for reverse proxy, instant messaging, file download, streaming media services and other functions as long as the corresponding plug-ins are installed. Sometimes we have installed Nginx, changed the use or found a lack of modules that are not installed. However, we do not want to reinstall and overwrite the already installed nginx, how can we add new modules? The following is illustrated by installing-- with-mail_ssl_module as an example, and installing other modules for the same reason.

1. Current nginx:

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

Configure arguments:-prefix=/usr/local/nginx-1.6.3-- with-http_ssl_module-- with-http_spdy_module-- with-http_stub_status_module-- with-pcre-- with-http_realip_module-- add-module=/root/ngx_cache_purge-1.3

2. Install:

Extract the same version of nginx source code package (previously installed source code package)

Tar zxf nginx-1.6.3.tar.gz

Cd nginx-1.6.3

. / configure (original parameter)-- prefix=/usr/local/nginx-1.6.3-- with-http_ssl_module-- with-http_spdy_module-- with-http_stub_status_module-- with-pcre-- with-http_realip_module-- add-module=/root/ngx_cache_purge-1.3-- with-mail_ssl_module

Compilation: make

But do not make install, this will overwrite the original program.

Mv / usr/local/nginx-1.6.3/sbin/nginx / usr/local/nginx-1.6.3/sbin/nginx_bak

Cp objs/nginx / usr/local/nginx-1.6.3/sbin/

3. Verify and check the module of nginx.

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

Configure arguments:-prefix=/usr/local/nginx-1.6.3-- with-http_ssl_module-- with-http_spdy_module-- with-http_stub_status_module-- with-pcre-- with-http_realip_module-- add-module=/root/ngx_cache_purge-1.3-- with-mail_ssl_module

Tags: Modules services servers functions source code installed same not only parameters commonly used cases plug-ins files file downloads sometimes streaming media versions uses examples Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei macOS Docker OPPO Reno Shulou Information