- 论坛徽章:
- 0
|
本帖最后由 也弹吉他 于 2011-03-28 18:17 编辑
求助:
背景:新搭了几个apache搜集访问日志给BI分析数据用
目标:我预期目标是让apache生成access_log时,写到按子目录内
故障: 不能在logs目录下创建按天区分的子目录
目录权限给apache的运行用户daemon了
简单的说就是 httpd/bin/rotatelogs 能制定时间变量来生成目录吗? 貌似不行啊~~
apche配置如下:NameVirtualHost *:80
<VirtualHost *:80>
ServerName analytics.domain.com
ServerAdmin sunnansong@domain.com
DocumentRoot "/export/analytics.domain.com/htdocs"
DirectoryIndex index.htm main.htm index.shtml
#ServerAlias
<Directory "/export/analytics.domain.com/htdocs">
Options FollowSymLinks
AllowOverride None
#Order deny,allow
Order allow,deny
Allow from all
</Directory>
LogFormat "%U,%{%Y-%m-%d %H:%M:%S}t,%h,%q" analytics_log
ErrorLog "/export/analytics.domain.com/logs/analytics.domain.com_err.log"
CustomLog "|/export/apache/bin/rotatelogs /export/analytics.domain.com/logs/date_%Y%m%d/domain_analytics_%Y%m%d%H.log 3600 480"
analytics_log
</VirtualHost>
apache报错如下:[Mon Mar 28 10:06:22 2011] [notice] Apache/2.2.17 (Unix) configured -- resuming normal operations
[Mon Mar 28 10:06:22 2011] [info] Server built: Mar 28 2011 15:17:10
[Mon Mar 28 10:06:22 2011] [debug] prefork.c(101 : AcceptMutex: sysvsem (default: sysvsem)
Could not open log file '/export/analytics.domain.com/logs/date_20110328/domain_analytics_2011032810.log' (No such file or directory)piped log program '/export/apache/bin/rotatelogs /export/analytics.domain.com/logs/date_%Y%m%d/domain_analytics_%Y%m%d%H.log 3600 480' failed unexpectedly |
|