0

使用 CentOS(特别是 Amazon EC2 Linux AMI)。我的 apache 上有 2 个虚拟主机,我希望它们登录不同的 rsyslog 设施,所以我这样配置我的主机:

<VirtualHost *:80>
        DocumentRoot /var/www/site1
        ServerName www.site1.com
        ServerAlias alias1

        ErrorLog syslog:local1
</VirtualHost>

<VirtualHost *:80>
        DocumentRoot /var/www/site3
        ServerName www.site3.com
        ServerAlias alias3

        ErrorLog syslog:local3
</VirtualHost>

在我的 rsyslog conf 中,我设置了 2 个转发规则:

local1.*    /logFile1
local3.*    /logFile3

但是一切都进入 logFile1,就好像 2 个虚拟主机正在共享 syslog 设施。我不明白发生了什么。

4

1 回答 1

2

我自己发现,关于 apache 文档(http://httpd.apache.org/docs/current/mod/core.html#errorlog)的注释说:

该设施实际上是全球性的,如果在单个虚拟主机中更改它,则指定的最终设施会影响整个服务器。

可悲的是。

于 2012-06-13T12:00:34.640 回答