4.nginx -p -c

nginx -p xxx -c xxx发生了什么

nginx -p aaa -c xxx.conf

nginx回去指定[aaa]目录下,查找xxx.conf配置文件

xxx.conf中的log路径,会在aaa/xxx/xxx.log中生成

# 在自己的家目录下创建ccc文件夹
mkdir ccc
# 执行-p和-c
nginx -p ./ccc/ -c nginx.conf
# 发现报错了,提示./ccc/logs/error.log和./ccc/nginx.conf没有这几个文件,
nginx: [alert] could not open error log file: open() "./ccc/logs/error.log" failed (2: No such file or directory)
2022/03/28 11:28:00 [emerg] 15363#0: open() "./ccc/nginx.conf" failed (2: No such file or directory)

# 复制原来的
cp -r /usr/local/temgine/logs ~/ccc
cp /usr/local/temgine/nginx.conf ~/ccc
posted @ 2022-03-29 00:38  lxd670  阅读(1404)  评论(0编辑  收藏  举报