这是一个创建于 3761 天前的主题,其中的信息可能已经有所发展或是发生改变。
系统是 ubuntu 12.04, 每次重启系统然后运行 nginx : /etc/init.d/nginx start 都会报错说 找不到 /var/log/nginx/error.log 这个文件, 我一检查 /var/log/nginx 这个目录没有了, 于是我手动创建一个后解决. 但下次重启后这个目录又没有了.
/etc/nginx/nginx.conf 中 http 块里明确指定了
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
3 条回复 • 1970-01-01 08:00:00 +08:00
![Livid](https://cdn.v2ex.com/avatar/c4ca/4238/1_normal.png?m=1719334330) |
|
1
Livid 2014-03-17 12:01:52 +08:00 via iPhone 1
df -h 看你的分区是怎么挂的。
也可以在 init.d/nginx 里加:
if [ ! -d /var/log/nginx ] then; mkdir /var/log/nginx fi
|
![jasontse](https://cdn.v2ex.com/gravatar/3ad8520d5ab1f4ddee0cc386684cb3a1?s=48&d=retro) |
|
2
jasontse 2014-03-17 12:16:50 +08:00 via iPad 1
你是不是把 /var/log 挂到 tmpfs 里去了?
|