2,117   Apache

apache 打印 http 头部信息,并且过滤特殊头部的 http 请求

1,记录 http 的头部信息

 LoadModule log_forensic_module /usr/lib64/httpd/modules/mod_log_forensic.so 
<IfModule log_forensic_module> 
ForensicLog /var/log/httpd/forensic_log 
</IfModule>

2,过滤特殊头部信息

 SetEnvIfNoCase ^test_header .+ test_header
<VirtualHost *:80>
 ServerAdmin webmaster@dummy-host.example.com
 DocumentRoot /var/www/html
 ServerName dummy-host.example.com
 ErrorLog logs/dummy-host.example.com-error_log
 CustomLog logs/dummy-host.example.com-access_log common
 <Directory /var/www/html>
 Order allow,deny
 Allow from all
 Deny from env=test_header
 </Directory>
</VirtualHost>



Leave a Reply

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