teginx编译安装FAQ

环境:centos7 

 OpenWAF开源地址 :

https://github.com/titansec/OpenWAF

部署安装文档:

https://www.w3cschool.cn/openwaf/openwaf-jxhy24os.html

 


 

  • 问题现象:编译安装完成之后,启动nginx报错
root@openwaf:/etc/nginx# /etc/init.d/nginx -t
/etc/init.d/nginx: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
  • 解决办法:
root@openwaf:/etc/nginx# cp -p /usr/local/lib64/libssl.so.1.1 /usr/lib64/
root@openwaf:/etc/nginx# cp -p /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/

 


 

  • 问题现象:报错如下图,原因可能是nginx配置中的用户不存在或者用户错误。
root@openwaf:/etc/nginx# /etc/init.d/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: [emerg] getpwnam("nginx") failed
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed 
  • 解决方法: 
root@openwaf:/etc/nginx# cat /etc/nginx/nginx.conf |grep ^user
user  nginx;
root@openwaf:/etc/nginx# useradd -M -s /sbin/nologin nginx  

 


 

问题现象:

root@openwaf:/opt# nginx -t -c /etc/ngx_openwaf.conf 
nginx: [emerg] unknown directive "lua_shared_dict" in /opt/OpenWAF/conf/twaf_main.conf:1

解决办法:可能是缺少nginx支持的开发库,lua-devel

root@openwaf:/opt# yum install lua-devel -y
root@openwaf:/opt# nginx -t 
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

总结:出现类似问题的优先考虑是否相应的开发库没有安装,或者nginx再编译的时候没有加相应的参数导致,都有可能。

转载于:https://www.cnblogs.com/petersonx/p/11046683.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值