安装mod_rpaf

  1. 下载源码编译
    wget https://fossies.org/linux/www/apache_httpd_modules/old/mod_rpaf-0.6.tar.gz
    tar -zxvf mod_rpaf-0.6.tar.gz
    cd mod_rpaf-0.6
    apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c

2.添加配置文件
vi /etc/httpd/conf/extra/httpd-includes.conf
LoadModule rpaf_module /usr/lib/apache/mod_rpaf-2.0.so

RPAFenable On
RPAFsethostname On
RPAFproxy_ips 127.0.0.1 123.125.46.16
RPAFheader X-Forwarded-For

3.重启apache
service httpd restart

进阶型
LogFormat "%{X-Forwarded-For}i %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" mod_rpaf

CustomLog /var/log/httpd/domains/xxxx.log mod_rpaf

发表新评论