SOggyの日記: Apache: mod_trigger
日記 by
SOggy
処理待ちなので、昨日の続き。mod_triggerのディレクティブ。
- TriggerEngine On or Off (Off by default). This enables the trigger engine.
- TriggerLog Triggers will send a log message to the error log when found.
- TriggerHandler Supply a handler and then either a script or uri to call if the handler is found.
- TriggerURI Supply a URI and then either a script or uri to call if the URI is found.
- TriggerAgent Supply a browser agent and then either a script or uri to call if the agent is found.
- TriggerReferer Supply a referer and then either a script or uri to call if the referer is found.
- TriggerMime Supply a mime-type and then either a script or uri to call if the mime-type is found.
- TriggerAddress Supply an IP address and then either a script or uri to call if the address is found.
- TriggerUser Supply a username (REMOTE_USER) and then either a script or uri to call if the user is found.
- TriggerIdent Supply an ident and then either a script or uri to call if the ident is found.
- TriggerPathInfo Supply a pthinfo and then either a script or uri to call if the pathinfo is found.
- TriggerAccept Supply an accept header and then either a script or uri to call if the accept header is found.
- TriggerCookie Supply a cookie name and then either a script or uri to call if the cookie is found.
makeしてインストールしてhttpd.confに追記して簡単にテスト。
<IfModule mod_trigger.c>
TriggerEngine on
TriggerAddress 192.168.5.7 /tmp/bang.sh
</IfModule>
うーん、TriggerAddressはネットマスクで指定できなさそうだ。呼んだ先でenvするとこんな感じ。
GATEWAY_INTERFACE=CGI/1.1
PWD=/
TRIGGER_PATH_INFO=
SERVER_PROTOCOL=HTTP/1.1
TRIGGER_SCRIPT_NAME=/server-info
TRIGGER_QUERY_STRING=
SCRIPT_NAME=/server-info
QUERY_STRING=
SHLVL=1
REQUEST_URI=/server-info
REQUEST_METHOD=GET
TRIGGER_FILENAME=/naisho/da/yo/server-info
_=/usr/bin/env
ふむ、楽しそうだ。
Apache: mod_trigger More ログイン