First, the compilation adds the new module
1. View the information of the previously compiled and installed Nginx /usr/local/nginx/sbin/nginx-v
2, enter the Nginx source directory CD nginx-1.8.0
3. Recompile code and modules
./configure--prefix=/usr/local/nginx--with-http_stub_status_module--with-http_ssl_module--with-file-aio-- With-http_realip_module
4, make, do not make install, or it will be covered by the installation
5, make after the OBJS directory in the more nginx, this is a new version of the program
6, back up the old Nginx Cp/usr/local/nginx/sbin/nginx/usr/local/nginx/sbin/nginx.bak
7, the new Nginx program covering the old program CP Objs/nginx/usr/local/nginx/sbin/nginx
8, test the new Nginx program is correct/usr/local/nginx/sbin/nginx-t
9, smooth restart Nginx/usr/local/nginx/sbin/nginx-s reload
10. View Nginx Information/usr/local/nginx/sbin/nginx-v
First, compile Add third-party module
1, re-compile the information /usr/local/nginx/sbin/nginx-v before Nginx
2, enter the Nginx source directory CD nginx-1.8.0
3. Recompile code and modules
./configure--prefix=/usr/local/nginx--with-http_stub_status_module--with-http_ssl_module--with-file-aio --add-module=/usr/ngx_pagespeed-master
4, make, do not make install, or it will be covered by the installation
5, make after the OBJS directory in the more nginx, this is a new version of the program
6, back up the old Nginx Cp/usr/local/nginx/sbin/nginx/usr/local/nginx/sbin/nginx.bak
7, the new Nginx program covering the old program CP Objs/nginx/usr/local/nginx/sbin/nginx
8, test the new Nginx program is correct/usr/local/nginx/sbin/nginx-t
9, smooth restart Nginx/usr/local/nginx/sbin/nginx-s reload
10. View Nginx Information/usr/local/nginx/sbin/nginx-v
Nginx Install the third-party module is actually using--add-module to reinstall the Nginx, but do not make install, but directly to the compilation directory of the Objs/nginx file to overwrite the old Nginx file, recompile, The previously compiled modules are also added.
Nginx Add new module and third party module