加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – Apache other_vhosts_access.log和access.log日志文件

发布时间:2020-12-14 02:45:28 所属栏目:Linux 来源:网络整理
导读:apache访问日志有一个奇怪的问题. 我正在为该网站写一个条目 /var/log/apache2/access.log 和 /var/log/apache2/other_vhosts/access.log 我正在使用Debian 6,在repo中使用最新的Apache. 当我查看文件 /etc/apache2/conf.d/other-vhosts-access-log 它说 # D
apache访问日志有一个奇怪的问题.
我正在为该网站写一个条目
/var/log/apache2/access.log

/var/log/apache2/other_vhosts/access.log

我正在使用Debian 6,在repo中使用最新的Apache.
当我查看文件

/etc/apache2/conf.d/other-vhosts-access-log

它说

# Define an access log for VirtualHosts that don't define their own logfile
CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined

但当我查看该网站的VirtualHost声明时,它有

CustomLog ${APACHE_LOG_DIR}/access.log vhost_combined
</VirtualHost>

在文件的底部.
所以我已经声明了日志文件,为什么apache仍然写入other_vhosts_access.log的条目?

最后,我在apache / conf.d文件中注释掉了这一行,但感觉不是最好的方法.

我错过了什么?

解决方法

如果没有看到完整的apache配置,这很难诊断,但需要注意一些事项

>检查您是否在同一个虚拟主机中不包含或定义第二个日志文件 – 这将导致双重日志记录.
>检查日志文件是否彼此没有链接 – 如果是,则查找/ var / log / apache2 -samefile /var/log/apache2/access.log将列出它们.

考虑这是一个错误的可能性.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读