apache 2.4无法安装mod_rpaf

  1. apache2.4已经有了mod_remoteip.so 但手头事情太多,没时间仔细研究,Directadmin无法正常加载,先行编译mod_rpaf达到要求
  2. 编译时提示的错误
  3. [root@server mod_rpaf-0.6]# apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c
  4. /var/www/build/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic   -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/include/apache  -I/usr/include/apache   -I/usr/include/apache   -c -o mod_rpaf-2.0.lo mod_rpaf-2.0.c && touch mod_rpaf-2.0.slo
  5. mod_rpaf-2.0.c: In function 'rpaf_cleanup':
  6. mod_rpaf-2.0.c:150: error: 'conn_rec' has no member named 'remote_ip'
  7. mod_rpaf-2.0.c:151: error: 'conn_rec' has no member named 'remote_addr'
  8. mod_rpaf-2.0.c:151: warning: implicit declaration of function 'inet_addr'
  9. mod_rpaf-2.0.c:151: error: 'conn_rec' has no member named 'remote_ip'
  10. mod_rpaf-2.0.c: In function 'change_remote_ip':
  11. mod_rpaf-2.0.c:164: error: 'conn_rec' has no member named 'remote_ip'
  12. mod_rpaf-2.0.c:183: error: 'conn_rec' has no member named 'remote_ip'
  13. mod_rpaf-2.0.c:186: error: 'conn_rec' has no member named 'remote_ip'
  14. mod_rpaf-2.0.c:187: error: 'conn_rec' has no member named 'remote_addr'
  15. mod_rpaf-2.0.c:187: error: 'conn_rec' has no member named 'remote_ip'
  16. apxs:Error: Command failed with rc=65536
  17. .
  1. 解决办法:
  2. wget http://mirror.trouble-free.net/sources/mod_rpaf-0.6.tar.gz
  3. tar xzvf mod_rpaf-0.6.tar.gz
  4. cd mod_rpaf-0.6
  5. git clone git://gist.github.com/2716030.git
  6. patch < 2716030/mod_rpaf-2.0.c.patch
  7. apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c

centos安装mod_rpaf

centos安装mod_rpaf

第三方的apache模块,用以支持apache在后端正确的显示IP头信息 前端类似Nginx Varnish等

  1. yum install httpd-devel gcc
  2.  
  3. wget http://stderr.net/apache/rpaf/download/mod_rpaf-0.6.tar.gz
  4. tar xzvf mod_rpaf-0.6.tar.gz
  5. cd mod_rpaf-0.6
  6. apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c
  7.  
  8.  
  9.  
  10. vi /etc/httpd/conf/httpd.conf
  11.  
  12. ## Begin Rpaf_mod
  13. LoadModule rpaf_module /usr/lib/apache/mod_rpaf-2.0.so
  14. RPAFenable On
  15. RPAFsethostname On
  16. RPAFproxy_ips Your_cache_IP
  17. RPAFheader X-Forwarded-For
  18. ## End Rpaf_mod
  19.  
  20.  
  21. service httpd restart

下载链接失效可用地址: http://mirror.trouble-free.net/sources/mod_rpaf-0.6.tar.gz

1 1