[아파치] access.log 설정

2013. 4. 10. 09:18·Programing
반응형

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-설정

반응형

'Programing' 카테고리의 다른 글

JSP로 엑셀(Excel) 다운로드 파일만들기(한글깨짐,숫자포함)  (0) 2013.06.14
[JAVASRIPT]팝업창 닫고 새로운 창 열기  (0) 2013.05.23
IE 호환성 보기 버튼 없애기  (0) 2013.01.09
[HTML]테이블이 긴글로 깨질때  (0) 2012.11.01
HTML 특수문자 기호표  (0) 2012.07.26
'Programing' 카테고리의 다른 글
  • JSP로 엑셀(Excel) 다운로드 파일만들기(한글깨짐,숫자포함)
  • [JAVASRIPT]팝업창 닫고 새로운 창 열기
  • IE 호환성 보기 버튼 없애기
  • [HTML]테이블이 긴글로 깨질때
애플자라
애플자라
    반응형
  • 애플자라
    애플자라
    애플자라
  • 전체
    오늘
    어제
    • 분류 전체보기 (655)
      • Linux (93)
      • Programing (92)
      • Flex, Laszlo (15)
      • Database (168)
      • Network (15)
      • Data (14)
      • Tips (119)
      • 여행★ (1)
      • Board (115)
      • 맛집탐방 (3)
      • 아이원츄 (12)
  • 블로그 메뉴

    • 홈
    • 태그
    • 미디어로그
    • 위치로그
    • 방명록
  • 링크

    • Love&Smile
    • Husk's repository
    • StartUp
    • DSDSTUDIO Experimentals
    • 신선
    • DEV.SEULKI.KR[이슬기]
    • Live Bit Block
  • 공지사항

  • 인기 글

  • 태그

    백업
    설정
    server
    apache
    파일
    tomcat
    리눅스
    DATABASE
    delete
    서버
    DB
    Windows
    mssql
    select
    user
    IP
    MySQL
    Toad
    데이터
    자동차
    윈도우
    sql
    table
    테이블
    eclipse
    오라클
    Oracle
    Shell
    Linux
    java
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
애플자라
[아파치] access.log 설정
상단으로

티스토리툴바