Configure apache Log Filtering

Source: Internet
Author: User
Tags apache log
By default, apache records all the web access request URLs in the access_log log. Each page contains a large number of static files, such as images, which results in fast expansion of access_log files, it has a certain impact on the server performance. At the same time, it is inconvenient for us to perform security analysis on access logs. Therefore, we can consider

By default, apache records all the web access request URLs in the access_log log. Each page contains a large number of static files, such as images, which results in fast expansion of access_log files, it has a certain impact on the server performance. At the same time, it is inconvenient for us to perform security analysis on access logs. Therefore, we can consider

By default, apache records all web access request URLs in access_log.LogsEach page contains a large number of images and other static files, resulting in fast expansion of access_log files, which has a certain impact on server performance.LogsSecurity Analysis is also inconvenient, so you can considerLogsRecordFilter. Edit the httpd. conf file and add the followingFilterRule: # fileter log: if visit images or static files, don't log
SetEnvIf Request_URI ". jpg $" filenotlog
SetEnvIf Request_URI ". gif $" filenotlog
SetEnvIf Request_URI ". bmp $" filenotlog
SetEnvIf Request_URI ". css $" filenotlog
SetEnvIf Request_URI ". txt $" filenotlogConfigurationJoinLogsFilterCondition: CustomLog "logs/access_log" common env =! Filenotlog checkConfigurationFile Syntax: [root @ weblogic bin] #./apachectl-t
Run Syntax OK to restart the apache process:
[Root @ weblogic bin] #./apachectl graceful ViewLogsThere should be no records of jpg, bmp, gif, css, and txt files not recorded above.

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.