一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

Apache2关闭 VirtualHost的Log日志记录

时间:2013-09-09 编辑:简简单单 来源:一聚教程网

 

Web server(ex: Apache2、Nginx..) 的存取留下 Log 可以观察很多东西、追踪、找问题 等等, 但是量太大的时候, 另外一个困扰也会出现, IO 吃紧, Loading 随著?高.

查官方网页的说明: Log Files - Apache HTTP Server, 居然找不到关闭的方法. XD

於 Apache2 想要将 VirtualHost 内某个 Domain 的 Log 记录关掉, 要如何做呢?


Apache2 关闭 VirtualHost 的 Log 记录 方法
想将 Apache2 VirtualHost 的 Log 记录关掉, 主要是下面两行:

■ErrorLog off # 关掉 Error Log 记录
■CustomLog /dev/null combined # 关掉 Access Log 记录

范例

 代码如下 复制代码



ServerName example.com
DocumentRoot /var/www/
# ErrorLog /var/log/apache2/error.log
# CustomLog /var/log/apache2/access.log combined
ErrorLog off
CustomLog /dev/null combined

热门栏目