nginx 重新部署,使用了新的用户时出现了权限异常

nginx 重新部署,使用了新的用户时出现了权限异常

之前已经通过一个用户ROOT进行部署了nginx,之后发现切换用户之后无法启动。出现了nginx默认相关配置异常的情况。

[sjzl@localhost nginx]$ ./nginx -c /home/sjzl/sjzl4.1/tongyongbanbase/soft/nginx/conf/nginx.conf
nginx: [alert] could not open error log file: open() "/root/sjzl4.1/tongyongbanbase/soft/nginx/logs/error.log" failed (13: Permission denied)
2019/12/09 11:22:17 [emerg] 15968#0: mkdir() "/root/sjzl4.1/tongyongbanbase/soft/nginx/client_body_temp" failed (13: Permission denied)

执行的时候指定了配置文件的路径,还是报错 :/home/sjzl/sjzl4.1/tongyongbanbase/soft/nginx/nginx -c /home/sjzl/sjzl4.1/tongyongbanbase/soft/nginx/conf/nginx.conf

后面查询nginx默认配置指令

[sjzl@localhost nginx]$ ./nginx -h
nginx version: nginx/1.10.1
Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives]

Options:
  -?,-h         : this help
  -v            : show version and exit
  -V            : show version and configure options then exit
  -t            : test configuration and exit
  -T            : test configuration, dump it and exit
  -q            : suppress non-error messages during configuration testing
  -s signal     : send signal to a master process: stop, quit, reopen, reload
  -p prefix     : set prefix path (default: /root/sjzl4.1/tongyongbanbase/soft/nginx/)
  -c filename   : set configuration file (default: conf/nginx.conf)
  -g directives : set global directives out of configuration file

发现-p的路径由于之前已经启动过,进行了默认的环境配置指令。

[sjzl@localhost nginx]$ ./nginx -p /home/sjzl/sjzl4.1/tongyongbanbase/soft/nginx  -c /home/sjzl/sjzl4.1/tongyongbanbase/soft/nginx/conf/nginx.conf

重新指定路径后。能够正常启动了。

[sjzl@localhost nginx]$ ./nginx -p /home/sjzl/sjzl4.1/tongyongbanbase/soft/nginx  -c /home/sjzl/sjzl4.1/tongyongbanbase/soft/nginx/conf/nginx.conf
[sjzl@localhost nginx]$  netstat -anp | grep nginx
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN      16004/nginx: master 
unix  3      [ ]         STREAM     CONNECTED     90303    16004/nginx: master  
unix  3      [ ]         STREAM     CONNECTED     90304    16004/nginx: master  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值