centos7+nginx1.6.2,配置目录/home/mysite绑定了100个网站(网站程序一样,链接数据库不一样)
然后他们的日志配置是
access_log /home/mysite/logs/$host/access.log main;
重新启动nginx,访问网站,访问日志没有生成,nginx错误日志中提示:
2014/12/22 23:56:11 [crit] 14021#0: *1 open() "/home/mysite/logs/xxxxA.com/access.log" failed (2: No such file or directory) while logging request, client$
修改nginx.conf
access_log /home/mysite/logs/$host.access.log main;
重启nginx再访问网站,错误日志:
2014/12/23 00:00:34 [crit] 14021#0: *6 open() "/home/mysite/logs/xxxxA.com.access.log" failed (13: Permission denied) while logging request, client: 113.$
[root@flxx nginx]# ll /home/mysitetotal 12 drwxr-xr-x 2 mysite root 4096 Dec 22 23:04 bak drwxr-xr-x 2 mysite root 4096 Dec 22 23:04 logs drwxr-xr-x 2 mysite root 4096 Dec 22 23:37 www
1)nginx 不同域名自动生成目录问题2)nginx 日志写入权限问题
子衿沉夜
慕尼黑5688855