(转)解决nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed错误 - nginx-sticky-module
重新启动服务器,访问web服务发现无法浏览啦!登陆服务器之后进到nginx使用./nginx -s reload重新读取配置文件,发现报nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)错误,进到logs文件发现的确没有nginx.pid文件
[root@localhost sbin]# ./nginx -s reload
nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)
解决方法:
[root@localhost nginx]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
使用nginx -c的参数指定nginx.conf文件的位置
2.nginx-sticky-module
sed -i 's?#include <ngx_sha1.h>?#include <ngx_sha1.h>\n#include <openssl/sha.h>\n#include <openssl/md5.h>?' /wxqyh/component/nginx/nginx-sticky-module/ngx_http_sticky_misc.c
cd /wxqyh/component/nginx/nginx-1.16.1
./configure --prefix=/wxqyh/component/nginx --add-module=/wxqyh/component/nginx/nginx-sticky-module --with-http_stub_status_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module --with-stream --with-http_realip_module
make && make install
用一个例子来演示会更加清晰