「Mod rpaf」の版間の差分

提供: MonoBook
ナビゲーションに移動 検索に移動
imported>Fallout New Tokyo
(ページの作成:「{{小文字}} '''mod_rpaf'''とは、リバースプロキシロードバランサーなどの配下にあるApache HTTP Serverにアクセス元の[[IP...」)
 
imported>Fallout New Tokyo
8行目: 8行目:
 
=== Mac OS X ===
 
=== Mac OS X ===
 
[[Mac OS X]]標準の[[apxs]]の設定がおかしいので修正する。これは他のモジュールを[[コンパイル]]する時もも同様である。
 
[[Mac OS X]]標準の[[apxs]]の設定がおかしいので修正する。これは他のモジュールを[[コンパイル]]する時もも同様である。
 +
<source lang="bash">
 
(cd /Applications/Xcode.app/Contents/Developer/Toolchains/; sudo ln -s XcodeDefault.xctoolchain OSX10.9.xctoolchain)
 
(cd /Applications/Xcode.app/Contents/Developer/Toolchains/; sudo ln -s XcodeDefault.xctoolchain OSX10.9.xctoolchain)
 +
</source>
  
[[Mac OS X]]ではapxs2のコマンド名が何故か「apxs」なので[[Makefile]]を修正する。
+
[[Mac OS X]]ではapxs2のコマンド名が何故か「apxs」なので[[vi]]などで[[Makefile]]を修正する。
 
*修正前:APXS2=$(shell which apxs2)
 
*修正前:APXS2=$(shell which apxs2)
 
*修正後:APXS2=$(shell which apxs)
 
*修正後:APXS2=$(shell which apxs)

2014年2月17日 (月) 01:46時点における版

mod_rpafとは、リバースプロキシロードバランサーなどの配下にあるApache HTTP Serverにアクセス元のIPアドレスを伝えるモジュールである。

概要

mod_rpafを入れてないとApache HTTP Serverで受け取れるアクセス元がすべてロードバランサーIPアドレスになるためアクセスログが意味不明になる。poundなどを利用しているときは必須である。

インストール

Mac OS X

Mac OS X標準のapxsの設定がおかしいので修正する。これは他のモジュールをコンパイルする時もも同様である。

(cd /Applications/Xcode.app/Contents/Developer/Toolchains/; sudo ln -s XcodeDefault.xctoolchain OSX10.9.xctoolchain)

Mac OS Xではapxs2のコマンド名が何故か「apxs」なのでviなどでMakefileを修正する。

  • 修正前:APXS2=$(shell which apxs2)
  • 修正後:APXS2=$(shell which apxs)

ビルドする。makeにはApache 2.xであることを明示する引数が必須なので注意すること。

make rpaf-2.0
make test-2.0
make install-2.0

設定ファイルの記述例

mod_rpaf2.conf

<IfModule !rpaf.c>
    LoadModule rpaf_module libexec/apache22/mod_rpaf2.so
    RPAFenable On
    RPAFsethostname On
    RPAFproxy_ips 127.0.0.1
    RPAFheader X-Forwarded-For
</IfModule>

httpd.conf

<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
        # mod_logioが有効な場合は転送量を記載する。
        LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    <IfModule logio_module>
        CustomLog "/var/log/httpd-access.log" combinedio
    </IfModule>
    <IfModule !logio_module>
        CustomLog "/var/log/httpd-access.log" combined
    </IfModule>
</IfModule>

関連項目

外部リンク

参考文献