How to add a new module after compiling nginx

nginx compiled to use the run for some time will need to install a module is not found, here to teach you how fast the new module

 

Example: After compiling nginx, you need to set tcp forward, found the original compiled without the added stream module, now take you to operate the new module

 

First, let us see when they are compiled before compiling those parameters:

# / Usr / local / nginx / sbin / nginx -V # Here is my nginx path, everyone does not pass

 

 Before compiling so many parameters are not compiled into the stream, misstep missteps

If the previous nginx still extract the directory, then the best, if not go to the official website to download a version of the same decompression nginx, nginx into the directory (nginx here is downloaded from the Internet before unpacked directory, is not currently running nginx directory, remember remember)

 

Enter the directory recompiled, the compiler found before the above parameters are put on, you need to add a new module on the back

# ./configure --prefix=/usr/local/nginx --modules-path=/usr/local/nginx/modules --conf-path=/usr/local/nginx/conf/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/usr/local/nginx/temp/client_temp --http-proxy-temp-path=/usr/local/nginx/temp/proxy_temp --http-fastcgi-temp-path=/usr/local/nginx/temp/fastcgi_temp --http-uwsgi-temp-path=/usr/local/nginx/temp/uwsgi_temp --http-scgi-temp-path=/usr/local/nginx/temp/scgi_temp --user=nginx --group=nginx --with-file-aio --with-http_image_filter_module --with-http_degradation_module --with-http_secure_link_module --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-jemalloc --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-zlib=/opt/soft/zlib-1.2.11 --with-openssl=/opt/soft/openssl-1.1.1b --with-openssl-opt=-fPIC --with-pcre=/opt/soft/pcre-8.43 --with-pcre-opt=-fPIC --with-pcre-jit --with-cc-opt='-O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=native' --with-ld-opt='-Wl,-z,relro -Wl,-E' --with-http_geoip_module=dynamic --with-luajit-lib=/usr/local/luajit/lib/ --with-luajit-inc=/usr/local/luajit/include/luajit-2.1/ --add-module=./modules/ngx_http_lua_module --add-module=/opt/soft/ngx_devel_kit-0.3.0rc1 --with-stream  --with-stream_ssl_module

After the next make, make the execution time may be a bit long, do not run make install after make

After you do make, the current directory will generate a objs directory, enter the directory

Directory nginx will produce a new program file, this is a new program file, the previous backup, a new copy of the past

# cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.back

# cp nginx /usr/local/nginx/sbin/nginx

After a copy of the past, we have compiled query again under those parameters nginx

 

 The new discovery parameters have been added on

Then you can go to operate the

 

Guess you like

Origin www.cnblogs.com/yangzhaon/p/12668472.html