웹마스터 팁

apache server의 log file 관리

2003.03.09 18:36

겨울늑대

아파치 서버의 로그파일중 access.log는 화일의 크기가 아주 빠른 속도로 늘어납니다.

하루 방문자가 몇천명인 site의 경우 file의 크기가 금방 몇백 MB가 되고 그 크기가
커질수록 web server의 속도도 떨어지는 것 같습니다. 따라서, log 화일의 효율적인
관리가 필요하죠. 하지만, log file이 없으면 webalizer 같은 분석화일을 쓸 수도 없고.

저도 오랫동안 고민하다가 logrotate를 사용하면서 문제를 허접스럽게 해결했습니다.

- cron file에서 webalizer를 매일 돌려줍니다 (새벽 4시쯤에 실행하도록 하면 되겠죠)
- webalizer가 끝나면 이어서 logrotate를 실행해줍니다 (cron으로 하는데 안전하게
   이틀에 한번정도 돌려주면 되겠죠)

webalizer를 설정할때 Incremental를 yes로 해줘야 합니다. 아니면 앞의 로그분석이
모두 없어집니다. 처음에 이것 때문에 로그분석 데이타를 많이 잃어버렸죠. ㅡ.ㅡㅋ

webalizer.conf에서 ... "#"을 없애면 됩니다.
---
# Incremental processing allows multiple partial log files to be used
# instead of one huge one.  Useful for large sites that have to rotate
# their log files more than once a month.  The Webalizer will save its
# internal state before exiting, and restore it the next time run, in
# order to continue processing where it left off.  This mode also causes
# The Webalizer to scan for and ignore duplicate records (records already
# processed by a previous run).  See the README file for additional
# information.  The value may be 'yes' or 'no', with a default of 'no'.
# The file 'webalizer.current' is used to store the current state data,
# and is located in the output directory of the program (unless changed
# with the IncrementalName option below).  Please read at least the section
# on Incremental processing in the README file before you enable this option.

Incremental     yes
---

허접스럽지만 이해 부탁드립니다. ^.^&

* traffic이 많은 사이트의 경우 webalizer를 한시간 단위, logrotate를 두시간 단위로
돌려준다면 log file이 크게 늘어나지 않토록 할 수 있습니다.
제목 글쓴이 날짜
mysql에서 사용자 권한을 잘못 부여하여 root로 접속불가, 사용권한 제한등 문제 해결방법 [3] 정종화 2003.03.20
Apache1.3.27 + PHP4.3.1 + MySQL4.0.12 + ZendOptimizer2.1.0 [6] FriZeX 2003.03.19
트래픽관리 Throttle-status 사용자 인증시키기 [1] Cksoft 2003.03.18
apache server의 log file 관리 [3] 겨울늑대 2003.03.09
php 의 보안 관련.. [7] Dopesoul 2003.03.08
안녕하세요, php 보안 취약점인데 한번 보시길.. [28] Dopesoul 2003.03.08
Sendmail 취약점 발표 [3] 조수권 2003.03.04
리눅스에서 한통 ADSL 설정해 주기.. [5] 이희덕 2003.03.02
apache-1.3.x설치⑥ (apahce, tomcat, resin가상호스팅설정) 비츠로 2003.03.02
apache-1.3.x설치⑤ (apahce설치, php가속기 추가) 비츠로 2003.03.02
apache-1.3.x설치④ (php4 + db + mail연동) 비츠로 2003.03.02
apache-1.3.x설치③ (tomcat4, jdk, jdbc연동) 비츠로 2003.03.02
apache-1.3.x설치③ (resin, jdk, jdbc연동) 비츠로 2003.03.02
apache-1.3.x설치② (mm, mod_ssl, mod_perl모듈) 비츠로 2003.03.02
apache-1.3.x설치① (필수조건과 pre configure) 비츠로 2003.03.02
qmail-1.03설치⑧ (squirrel웹메일과 연동) 비츠로 2003.02.28
qmail-1.03설치⑦ (qmailadmin 큐메일 웹관리툴) 비츠로 2003.02.28
qmail-1.03설치⑥ (qmail-scanner 스팸필터링) 비츠로 2003.02.28
qmail-1.03설치⑤ (courier-imap연동) 비츠로 2003.02.28
qmail-1.03설치④ (vpopmail+mysql) 비츠로 2003.02.28