nginx编译ssl模块
几个官网在一台服务器上面,其中一台是https的,增加一个官网以,重启nginx以后,https的网站直接报错,大意是ssl 在配置文件中unknow,但是这个https网站已经运行很久了,一时间有点郁闷,掉坑里了。查看nginx信息 /usr/local/nginx/sbin/nginx -V显示不支持ssl,那就好办,重新编译下ssl,但是线上业务跑着,难免有点担心,在测试机上跑了一次,正常的,才敢到线上操作,大致如此从网上找的如下:
进入nginx源码目录:
cdnginx-1.6.2
./configure --prefix=/usr/local/nginx --user=www --group=www--with-http_stub_status_module --with-http_ssl_module --with-file-aio --with-http_realip_module
只添加ssl功能模块,有别的需求继续加上;
运行完以后记得是make,make,make不是make & make install ,install就覆盖安装了,千万搞清楚~
make以后在当前目录生成odjs目录,下面就是新的nginx;
剩下就好办,备份原来的nginx,把新生成的nginx替换原来的,
备份旧的nginx程序
cp /usr/local/nginx/sbin/nginx/usr/local/nginx/sbin/nginx.bak
把新的nginx程序覆盖旧的
cp objs/nginx /usr/local/nginx/sbin/nginx
测试新的nginx程序是否正确
/usr/local/nginx/sbin/nginx -t
nginx: theconfiguration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx:configuration file /usr/local/nginx/conf/nginx.conf test issuccessful
平滑重启nginx
/usr/local/nginx/sbin/nginx -s> 查看ngixn版本极其编译参数
/usr/local/nginx/sbin/nginx -V
configure arguments: --prefix=/data/app/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-file-aio --with-http_realip_module
再试试https网站就可以了;没多大参考价值权作一个跳坑记录。
页:
[1]