로그 화일 자동 조절하기


아파치 로그는 wtmp, lastlog 등과 같이 일정 시간, 크기 등등에 따라

로그의 순환 이 이루어지지 않습니다.


logrotate 로 3개의 로그를 1달단위로 순환 하려면

/etc/logrotate.conf 파일의 마지막에 다음과 같이 추가 합니다.

# system-specific logs may be configured here

/usr/local/apache/log/
xxx.com {
monthly
rotate 2
}
 




/usr/local/apache/log/
access_log{
monthly
rotate 2
}

adplant-access_log
adplant-error_log
adplant.-error_log
adplant_inline-access_log
adplant_inline-error_log
adplant_inline.-error_log
adplant_loan-access_log
adplant_loan-error_log
adplant_loan.-error_log
error_log



============실제적용내용======================

/etc/logrotate.conf

--------------------------------------------------------------

# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
    monthly
    create 0664 root utmp
    rotate 1
}


# system-specific logs may be also be configured here.
/usr/local/apache/logs/adplant-access_log {
    monthly
    rotate 6
##    mail
land@adplant.co.kr
##    errors land@adplant.co.kr
    postrotate
        /etc/rc.d/init.d/httpd restart 2>/dev/null || true
    endscript
}

----------------------------------------------------------


->로그생성후 아파치 재시작하도록 해놈



logrotate참고


-> http://www.superuser.co.kr/linux/logrotate/page01.htm

-> http://blog.naver.com/endfirst.do?Redirect=Log&logNo=20003220847


'서버.보안' 카테고리의 다른 글

* ISP별 DNS 서버 주소 리스트  (0) 2007/03/21
MySql 관리용 query [ver 0.1]  (0) 2006/11/15
로그 화일 자동 조절하기  (0) 2006/10/16
서버종합점검[리눅스]  (0) 2006/10/16
Vimrc 파일내용.  (0) 2006/07/28
APM설치 랜드판(apche2 붙이기)  (0) 2006/07/28
Posted by landzz
◀ PREV : [1] : ... [70] : [71] : [72] : [73] : [74] : [75] : [76] : [77] : [78] : ... [81] : NEXT ▶


BLOG main image
사람은 공들여 생각하는대로 살지 않으면 결국은 사는대로 생각하게 된다고 합니다. 당신은 어떤삶? by landzz

공지사항

카테고리

분류 전체보기 (81)
Tenor~엄군 (12)
이런저런 (16)
유용한것들 (4)
작업관련팁들 (1)
서버.보안 (11)
프로그램.코딩 (13)
HTML.Js (3)
Windows Tip (0)
듣고보고 (5)
생각해보고 (13)
Misc (0)

최근에 받은 트랙백

Total : 34,348
Today : 3 Yesterday : 7