Web server (ex: Apache2, Nginx ..) the Log is left to observe a lot of things, tracking, problem locating, and so on. However, when the amount is too large, another problem also occurs, IO is tight, and Loading is keeping going? High.
Check the instructions on the official webpage: Log Files-Apache HTTP Server, but you cannot find the method to disable it. XD
What should Apache2 do to disable the Log records of a Domain in VirtualHost?
Apache2 closes the Log record of VirtualHost
To disable the Log record of Apache2 VirtualHost, the following two lines are used:
■ ErrorLog off # Turn off the Error Log record
■ CustomLog/dev/null combined # disable Access Log records
Example
The code is as follows: |
Copy code |
<VirtualHost *: 80> 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 </VirtualHost>
|