Apache2 disables the Log record of VirtualHost

Source: Internet
Author: User

 

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.