Turning off Apache log files

The company's antivirus server ran into a hard drive space shortage problem,It was initially thought to be caused by the ever-increasing virus definitions and related programs,Upon investigation, it was found that it was actually caused by Apache associated with the antivirus system。

  Apache在程式目錄底下有個log資料夾,裡頭存放存取及錯誤資訊的相關紀錄,在我的Server上,其中access.log的大小已經高達10G,因此勢必要來進行個瘦身計劃。

 

  在網路上可以找到很多針對此log做分割的指令,測試過後,決定直接讓Apache不予產生這些log,因此只須將語法備註起來即可。

1.開啟httpd.conf

2.搜尋"access.log",將"CustomLog logs/access.log combined"前面加上"#"。

3.搜尋"errorlog",將"ErrorLog logs/error.log"前面加上"#"。

4.Save the file,Restart Apache。

 

[Related Links]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.