티스토리 뷰

Programing

[아파치] access.log 설정

애플자라 2013. 4. 10. 09:18
반응형

access.log를 보면 이미지부터 js, css 모두 출력해주는 것을 볼 수 있다.

그런 파일들이 필요한 사람들도 있겠지만.. 나는 필요 없다.

 

httpd.conf의 IfModule log_config_module부분을 살펴보면 access_log에 출력할 확장자를 필터 할 수 있는 기능이 있다.

분홍색 음영부분이 설정된 부분이다.

 

 

<IfModule log_config_module>
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    #
    #LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}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>

    #
    # The location and format of the access logfile (Common Logfile Format).
    # If you do not define any access logfiles within a <VirtualHost>
    # container, they will be logged here.  Contrariwise, if you *do*
    # define per-<VirtualHost> access logfiles, transactions will be
    # logged therein and *not* in this file.
    #
#    CustomLog "logs/access.log" common

SetEnvIf Request_URI \.gif img-nosave
SetEnvIf Request_URI \.jpg img-nosave
SetEnvIf Request_URI \.png img-nosave
SetEnvIf Request_URI \.css img-nosave
SetEnvIf Request_URI \.js img-nosave

    CustomLog "|/usr/local/apache/bin/rotatelogs /usr/local/apache/logs/access.log.%Y%m%d 86400" combined env=!img-nosave

    #
    # If you prefer a logfile with access, agent, and referer information
    # (Combined Logfile Format) you can use the following directive.
    #
    #CustomLog "logs/access.log" combined
</IfModule>

<IfModule log_config_module>
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    #
    #LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}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>

    #
    # The location and format of the access logfile (Common Logfile Format).
    # If you do not define any access logfiles within a <VirtualHost>
    # container, they will be logged here.  Contrariwise, if you *do*
    # define per-<VirtualHost> access logfiles, transactions will be
    # logged therein and *not* in this file.
    #
#    CustomLog "logs/access.log" common

SetEnvIf Request_URI \.gif img-nosave
SetEnvIf Request_URI \.jpg img-nosave
SetEnvIf Request_URI \.png img-nosave
SetEnvIf Request_URI \.css img-nosave
SetEnvIf Request_URI \.js img-nosave

    CustomLog "|/usr/local/apache/bin/rotatelogs /usr/local/apache/logs/access.log.%Y%m%d 86400" combined env=!img-nosave

    #
    # If you prefer a logfile with access, agent, and referer information
    # (Combined Logfile Format) you can use the following directive.
    #
    #CustomLog "logs/access.log" combined
</IfModule>

 출처 - http://cipleme.tistory.com/entry/아파치-accesslog-설정

반응형
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/11   »
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
글 보관함