nginx: invalid option: “‐c -reload”
不知道为什么 他将 -c 读成了 “-c -reload” 无法识别这个命令,不知道是镜像的问题还是软件的问题
nginx -h 查看其他命令
nginx -t 测试配置文件是否正确
然后又重启了虚拟机
shutdown -r 0
开机之后运行nginx报错:
CentOS启动nginx出现nginx: [emerg] open() “/var/run/nginx/nginx.pid” failed (2: No such file or director)
原因:没有nginx文件夹,且其下没有 nginx.pid文件
解决办法:
cd /var/run
mkdir nginx
touch nginx.pid
重启nginx
引用:https://blog.csdn.net/z_cc_csdn/article/details/78122282