环境: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 -tnginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is oknginx: [emerg] getpwnam("nginx") failednginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
- 解决方法:
root@openwaf:/etc/nginx# cat /etc/nginx/nginx.conf |grep ^useruser 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 -yroot@openwaf:/opt# nginx -t nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is oknginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
总结:出现类似问题的优先考虑是否相应的开发库没有安装,或者nginx再编译的时候没有加相应的参数导致,都有可能。