Home > Article > Operation and Maintenance > How to add stream module to nginx
Specific method:
(Recommended tutorial: nginx tutorial)
View nginx current module
/usr/local/nginx/sbin/nginx -V
For example:
nginx version: nginx/1.12.2 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) configure arguments: --add-module=/usr/local/fast/fastdfs-nginx-module/src/
Add module stream
cd /usr/local/nginx-1.12.2 #需要把之前的参数带上 ./configure --add-module=/usr/local/fast/fastdfs-nginx-module/src/ --with-stream make (切忌不要输入make install,否则会覆盖掉nginx文件)
Stop nginx
ps -ef | grep nginx|grep -v grep|cut -c 9-15|xargs kill -9
cp nginx file
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak cp /usr/local/nginx-1.12.2/objs/nginx /usr/local/nginx/sbin/
Start nginx
/usr/local/nginx/sbin/nginx
View dependent modules
/usr/local/nginx/sbin/nginx -V
The above is the detailed content of How to add stream module to nginx. For more information, please follow other related articles on the PHP Chinese website!