생활 속 지혜, SW/HW Tip 등 유용한 지식 정보를 공유하는 장소 입니다.
본 게시판의 열람 및 다운로드는 비회원도 가능하나 글쓰기 및 댓글은 로그인 사용자만 가능합니다.

apache2 access log 분할 관리 하기

조회 수 2201 추천 수 0 2010.05.25 12:39:03

서버환경

OS : Winodws XP

Apache version : 2.X

 

Apache2의 log를 분할 관리하는 방법에 대하여 조사해본 결과 rotatelogs.exe와 cronolog.exe가 많이 사용되고 있었습니다.

 

하지만 제가 설치해본 결과 아래 그림처럼 CMD 창이 계속 활성화 되는 버그가 생기더군요...

bug_cronolog.jpg

 

따라서 여러 방면으로 검색하던 결과  module mod_log_rotate를 사용하여 로그 파일을 관리하는 방법이 있었습니다.

 

1. 첨부 파일 중 해당되는 파일을 다운로드

Module : mod_log_rotate222_08_2006.so

DLL : mod_log_rotate222_08_2006.dll

Apache 2.2 이하 버젼 : http://www.sitebuddy.com/mod_log_rotate

 

2. Httpd.conf 수정

#To load this module, modify your httpd.conf:  (module을 사용하는 경우)
LoadModule log_rotate_module modules/mod_log_rotate.so
#or if using the DLL version (dll을 사용하는 경우)
LoadModule log_rotate_module modules/mod_log_rotate.dll

 

3. httpd.conf 혹은 httpd-vhosts.conf(가상호스트 사용시) 수정

 

    RotateLogs On
    RotateLogsLocalTime On
    RotateInterval 86400
    ErrorLog /apache2/logs/sever--error.log 
    CustomLog logs/sever-access_%m_%d_%Y_%H_%i.log combined 

 

4. 아파치 재 실행

 

주1) error-log는 작동하지 않으며 오직 access log에만 작동한다는 단점이 있습니다.

 

주2)

RotateLogs On|Off 
Enable / disable automatic log rotation. Note: On Apache 2, once enabled mod_log_rotate takes responsibility for all log output server wide even if RotateLogs Off is subsequently used. That means that the BufferedLogs directive that is implemented by mod_log_config will be ignored. As BufferedLogs isn’t document and is flagged as an experimental feature this shouldn’t be a problem in production environments. This doesn’t apply to the Apache 1.3 version of the module.


RotateLogsLocalTime On|Off
Normally the log rotation interval is based on UTC. For example an interval of 86400 (one day) will cause the logs to rotate at UTC 00:00. When this option is on, log rotation is timed relative to the local time.


RotateInterval <interval> [<offset>]
Set the interval in seconds for log rotation. The default is 86400 (one day). The shortest interval that can be specified is 60 seconds. An optional second argument specifies an offset in minutes which is applied to UTC (or local time if RotateLogsLocalTime is on). For example RotateInterval 86400 60 will cause logs to be rotated at 23:00 UTC.

 

출처 : http://www.sitebuddy.com/

List of Articles
번호 제목 글쓴이 날짜 조회 수
22 KT유저들 SK와이파이(T Wi-fi) 사용방법 SCM 2011-03-22 982
21 칼라 pdf를 흑백으로 출력하기 file 네오랑 2011-03-18 969
20 신용 카드 없이 iTunes App Store 계정 생성 file 네오랑 2010-10-22 2213
19 MS Office 2007 Muilt View (2 monitors more) file 원잇 2010-06-21 2461
18 홈페이지 (블로그)에 MSN 메신저 설치하기 file SCM 2010-06-17 2277
17 무설치 Input Director 만들기 file 네오랑 2010-06-03 2952
16 JW Player 워터마크 삭제 및 버튼, 배경 색깔 변경 file SCM 2010-06-01 3140
15 JW Player 편집하기 01 (컴파일 하기) file SCM 2010-06-01 3524
14 사이트 접속 시 domain.com/xe 에서 xe 없애기 file SCM 2010-05-25 2436
13 Using Google Calendar on XE (구글 캘린더를 XE에 사용하기) file SCM 2010-05-25 2603
» apache2 access log 분할 관리 하기 file SCM 2010-05-25 2201
11 Apache Error : winnt_accept: Asynchronous AcceptEx failed. SCM 2010-05-24 2414
10 Apache Error : unable to include potential exec "include/top.html" SCM 2010-05-24 2157
9 Textyle 블로그 메인 주소를 blog.domain.com 로 설정하기 file SCM 2010-05-18 2287
8 원격 데스크톱 연결 끊김 (Windows XP 이상) file SCM 2010-05-18 3151
7 DNSEver를 이용한 2차 도메인 일괄 셋팅 방법(바로 적용하기) file SCM 2010-05-18 2192
6 XE 메일 인증 시 ID/PW 정보 없이 빈 페이지만 올 경우 file SCM 2010-05-15 2342
5 Fake sendmail with ssl gmail for windows XP & XE (xpressengine) file SCM 2010-05-15 3170
4 Apache2 openssl on Winows XP (https 접속) file SCM 2010-05-15 2539
3 XE에서 SMTP 비밀번호 찾기 등의 메일 인증 (윈도우용 서버) file [1] SCM 2010-05-12 2873



XE Login