环境:centos7
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:/etc/nginx# /etc/init.d/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
原文:https://www.cnblogs.com/petersonx/p/11046683.html