上线遇到nginx问题

[root@node2 ~]# nginx -t
-bash: /usr/local/bin/nginx: Permission denied

赋权限

[root@node2 sbin]# chmod /home/nginx
chmod: missing operand after ‘/home/nginx’
Try 'chmod --help' for more information.
[root@node2 sbin]# chmod 777 /home/nginx
[root@node2 sbin]# ./nginx -t
-bash: ./nginx: Permission denied
[root@node2 sbin]# chmod 777 /home/nginx/sbin

有了全局命令了,和操作权限了

 

执行了nginx -s stop之后, 报错:

[root@node2 sbin]# nginx -s reload
nginx: [error] invalid PID number "" in "/home/nginx/logs/nginx.pid"

解决:

/home/nginx/sbin/nginx -c /home/nginx/conf/nginx.conf

ok了,命令恢复

 

posted @ 2021-05-27 23:47  mabiao008  阅读(205)  评论(0编辑  收藏  举报