处理办法一
nginx版本下载:
http://nginx.org/en/download.html
nginx -V 查看当前版本是否存在stream模块:
编译包括stream模块的nginx
apt-get install openssl libssl-dev
apt-get install libpcre3 libpcre3-dev
apt-get install zlib1g
apt-get install zlib1g.dev
若不能安装。就需要先安装装ruby 然后再装zlib1g-dev
apt-get install zlib1g-dev
apt install libgd-dev
apt-get install libgeoip-dev
apt install gcc automake make autoconf libtool
make编译后,在生成的/objs/目录下:
运行
./nginx -V
查看当前nginx版本:
备份之前的nginx
替换后查看版本:
此时启动nginx,报错:
nginx: [emerg] module "ngx_stream_module" is already loaded in /etc/nginx/modules-enabled/50-mod-stream.conf:1
至该目录,将50-mod-stream.conf 重命名,再重启即可
处理办法二(配置错误导致):
在添加/vhosts/*.conf在nginx.conf中时,添加在了http段,而其实应该直接添加在外面即可:
也就是默认apt install nginx之后,是默认携带stream模块的