1.前期
# 查看上次编译的模块
nginx -V
2.源码包编译
进入对应版本的源码包,之前已经删除可以重新下载
wget https://nginx.org/download/nginx-1.22.1.tar.gz
--with-stream
# 带上之前的参数
./configure --prefix=/usr/local/environment/nginx1.22 --with-http_stub_status_module --with-http_ssl_module --with-stream
# 切忌不要输入make install,否则会覆盖掉nginx文件
make
make完之后会出现objs/nginx文件夹,我们的目的就是以其替换掉nginx应用sbin/nginx文件夹
# 停止nginx
nginx -s stop
# 备份原nginx
mv /usr/local/environment/nginx1.22/sbin/nginx /usr/local/environment/nginx1.22/sbin/nginx.bak
# 复制到应用目录
cp objs/nginx /usr/local/environment/nginx1.22/sbin/
# 启动nginx
nginx
# 查看是否已经有了--with-stream
nginx -V
查看是否已经有了--with-stream
END!
标签:environment,stream,nginx,--,---,Nginx,usr,local From: https://www.cnblogs.com/a999/p/17635432.html