[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[connect24h:0259] Re:apacheのCustomLogの設定
- To: connect24h@xxxxxxxxxx
- Subject: [connect24h:0259] Re:apacheのCustomLogの設定
- From: asami@xxxxxxxxxxxxxxxxxxx
- Date: Sun, 14 Oct 2001 02:03:30 +0900
On 2001/10/14 1:08:34
Makoto <makoto999@xxxxxxxxxx> wrote:
by Becky! ver. 2.00.07 :
[connect24h:0258] apacheのCustomLogの設定 への返信です
> apacheのログの設定で,次のことをやろうとしています。
> (1)ローカルからのアクセスはロギングしない。
> (2).html .htm .cgi ファイルへのアクセスのみロギングする。
> まず,(1)だけなら次の方法でできました。
> SetEnvIf Remote_Addr 192.168.0. no-log
> CustomLog /var/log/httpd/access_log common env=!no-log
> 次に,(2)だけなら次の方法でできました。
> SetEnvIf Request_URI "(/|\.html|\.htm|\.cgi)$" only-page
> CustomLog /var/log/httpd/access_log common env=only-page
> (1)と(2)を同時にやる方法はあるでしょうか?
> Webを色々検索してみましたが,
> envに条件を複数設定する方法はどこにも見付かりませんでした。
そんなはずはありません。下のところでちょっと前に出たような話なんで
意味の取り違えかな・・
env=+*P env=iuyt みたいに指定することを言っているならそれは出来ません。
> そこで,適当に次のように試してみたのですが,全部ダメでした。
> 1)
> SetEnvIf Remote_Addr 192.168.0. no-log
> SetEnvIf Request_URI "(/|\.html|\.htm|\.cgi)$" only-page
> CustomLog /var/log/httpd/access_log common env=!no-log&only-page
> 2)
> SetEnvIf Remote_Addr 192.168.0. no-log
> SetEnvIf Request_URI "(/|\.html|\.htm|\.cgi)$" only-page
> CustomLog /var/log/httpd/access_log common env=!no-log env=only-page
Apache newbieのMLの1190-1200,1395-1399あたりを参照すればわかるかと思いますが、
CustomLog takes two or three arguments, a file name, a custom log format
string or format name, and an optional "env=" clause (see docs)
#an がポイント
> 3)
> SetEnvIf Remote_Addr ^192.168.0. no-log
> SetEnvIf Request_URI "(/|\.html|\.htm|\.cgi)$" no-log
> CustomLog /var/log/httpd/access_log common env=no-log
これを順番入れ替えて正規表現を正しく書いてちょこっと変えればいいような。
(気はする)
今からテストするのは辛いんで試してないから嘘書いてるかも(^^;;
BIBLONE3
Nobuyuki Morita
rena19@xxxxxxxxxxxxxxxxxxxx
--[PR]------------------------------------------------------------------
●衝撃価格●ブロードバンド・ADSLは1,980円!
⇒ http://www.bbol.jp/?mid=101682
------------------------------------------------------------------[PR]--