关闭错误并访问一台虚拟主机的日志


18

如果我没有在虚拟主机中设置错误日志,它将默认为默认错误/访问日志。有没有办法为一个虚拟主机关闭此功能?

Answers:


35

<VirtualHost>有关虚拟主机的块中,您可以配置要发送到/ dev / null的日志

<VirtualHost *:80>
     ServerName nologserver.tld

     ErrorLog /dev/null
     CustomLog /dev/null common
</VirtualHost>

在Windows上也可以使用吗?
乌威·基姆

1
@UweKeim不,我也在寻找Windows解决方案...
TheStoryCoder

0

将/etc/apache2/conf-enabled/other-vhosts-access-log.conf更改为以下内容:

ErrorLog /dev/null

CustomLog /dev/null common

更改后重新启动apache时,出现以下错误:/etc/apache2/sites-enabled/example.com的第71行的语法错误:CustomLog带有两个或三个参数,文件名,自定义日志格式字符串或格式名称,以及可选的“ env =”子句(请参阅文档)
John Magnolia
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.