Apache 2.2 y registro en log de IP público tras un proxy o balanceador

El Blog de Dragonfly

Installation of mod_rpaf on CentOS from Source

The below instructions can be used to install mod_rpaf on CentOS 5 and CentOS 6. It can also be used to install mod_rpaf on RHEL and Fedora Core.

Note: You must make sure that the Apache2 Development Package (CentOS httpd-devel) is installed on your server before you start installing mod_rpaf using the below instructions.

  1. Ensure that the package 

     is installed. To install this package run:

    <code>yum install httpd-devel </code>
  2. Download and Extract the mod_rpaf package:

    <code>cd /usr/local/src wget http://mirror.trouble-free.net/sources/mod_rpaf-0.6.tar.gz tar xzvf mod_rpaf-0.6.tar.gz cd mod_rpaf-0.6 </code>
  3. Build and install mod_rpaf:

    <code>apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c </code>
  4. Add mod_rpaf to Apache configuration:

    <code>nano /etc/httpd/conf/httpd.conf </code>
  5. Find the 'LoadModule' list (near the top) and add the following lines at the bottom of the 'LoadModule' list:

    <code>LoadModule rpaf_module modules/mod_rpaf-2.0.so RPAFenable On RPAFsethostname On RPAFproxy_ips A.B.C.D RPAFheader X-Real-IP </code>

    Important Note: Where «A.B.C.D» is, add your proxy server IP address(es), multiple addresses can be space separated. This will tell mod_rpaf which hosts to get X-Real-IP headers from.

  6. You are now finished. Restart Apache using below commands for the changes to take place:

    <code>/etc/init.d/httpd restart</code>

  • 0
  • 0
  • Compartir en Facebook

0 comentarios

Para escribir comentarios debes registrarte.