티스토리 뷰

1. 문법

    SetEnvIf Remote_Addr "^192.168.1.10[23]$" do_not_log

    CustomLog logs/access.log common env=!do_not_log

       

    SetEnvIf 를 통해  "do_not_log" 변수를 만든다.

       

    =================================================

    Remote_Host - 요청하는 클라이언트의 호스트명

    Remote_Addr - 요청하는 클라이언트의 IP 주소

    Server_Addr - 요청을 받는 서버의 IP 주소

    Request_Method - 사용한 Method 명 (GET, POST 등)

    Request_Protocol - 요청의 프로토콜 이름과 버젼 ("HTTP/1.1" 등)

    Request_URI - 요청의 Query String을 제외한 호스트명 이후의 주소

    =================================================

       

    정규표현식 예)

    SetEnvIf Remote_Addr "^127.0.0.1$" do_not_log   --> loopback

    SetEnvIf Remote_Addr "^211.35.159.12[89]$" do_not_log --> 211.35.159.128~129 2개의 IP

    SetEnvIf Remote_Addr "^211.35.159.1[345][0-9]$" do_not_log 

    --> 211.35.159.130 ~ 211.35.159.139 10개의 IP 주소

         211.35.159.140 ~ 211.35.159.149 10 개의 IP 주소

         211.35.159.150 ~ 211.35.159.159 10 개의 IP 주소

   

   

   

   

2. 설정 ( 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>

          # You need to enable mod_logio.c to use %I and %O

          LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

        </IfModule>

       

        SetEnvIf Remote_Addr "^192.168.6.18[23]$" do_not_log

       

        CustomLog "|/home/monitor/apache/bin/rotatelogs /home/monitor/apache/logs/access_log_%Y%m%d 50M" common env=!do_not_log

       

    </IfModule>

    =========================================================================

'WEB,WAS > Web Server' 카테고리의 다른 글

Apache Worker 방식의 이해 및 설정법  (5) 2010.10.12
[Apache] MPM(Prefork VS Worker)  (1) 2010.10.08
[Apache] Virtualhost 설정  (0) 2010.10.08
Apache log에 favicon.ico 출력 안되게 하기  (0) 2010.10.05
[Apache] (MPM) Perfork / worker  (0) 2010.07.17
[Apache] KeepAlive 설정  (0) 2010.07.17
[Apache] Alias  (0) 2010.07.17
[Apache] ErrorDocument 설정  (0) 2010.07.17
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함