This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
mod_realip [2010/05/19 01:49] kyxap создано |
mod_realip [2016/08/08 21:29] (current) kyxap |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ==== mod_realip для apache 2.2.x ==== | + | {{tag>apache realip}}====== mod_realip для apache 2.2.x ====== |
| + | |||
| + | **apache2.4** | ||
| + | |||
| + | <file conf /etc/apache2/mods-enabled/remoteip.conf> | ||
| + | RemoteIPHeader X-Real-IP | ||
| + | RemoteIPTrustedProxy 127.0.0.1 | ||
| + | </file> | ||
| + | |||
| + | **apache2.2** | ||
| Не требует никакой настройки, достаточно скомпилировать и установить. При необходимости можно изменить заголовок с X-Real-IP на желаемый. | Не требует никакой настройки, достаточно скомпилировать и установить. При необходимости можно изменить заголовок с X-Real-IP на желаемый. | ||
| Line 5: | Line 14: | ||
| # apxs -a -i -c mod_realip.c | # apxs -a -i -c mod_realip.c | ||
| - | <code lang=C> | + | <code C> |
| #include "httpd.h" | #include "httpd.h" | ||
| #include "http_config.h" | #include "http_config.h" | ||
| Line 44: | Line 53: | ||
| </code> | </code> | ||
| + | ===== Изменения для apache 2.4.x ===== | ||
| + | |||
| + | # sed 's/remote_ip/client_ip/g;s/remote_addr/client_addr/g' -i mod_realip.c | ||