揮発性のメモ2

http://d.hatena.ne.jp/iww/

リバースプロキシの設定

次の設定をおこなう。

ProxyPass        /hoge http://172.16.101.51/piyo
ProxyPassReverse /hoge http://172.16.101.51/piyo

ディレクティブは無い。ルート部分に直接書くだけなので、適当なファイルに分けてconf.dに置いて良い。
編集後は設定ファイルを再読み込み

service apache2 restart
# apache2ctl configtest

Syntax error on line 1 of /etc/apache2/conf.d/hoge.conf:
Invalid command 'ProxyPass', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.

こんな感じのエラーが出たときはモジュールが足りてない

# a2enmod proxy_http
Considering dependency proxy for proxy_http:
Enabling module proxy.
Enabling module proxy_http.
To activate the new configuration, you need to run:
  service apache2 restart

# apache2ctl configtest
Syntax OK