logrotate 설정
Apache
2016. 2. 25. 10:08
1. /etc/logrotate.d
/var/log/httpd/*log {
daily
rotate 10
missingok
notifempty
sharedscripts
delaycompress
postrotate
/sbin/service httpd reload > /dev/null 2>/dev/null || true
endscript
}
2. cd /var/log
cp -arf httpd httpd_bak
cd httpd
rm -f *
3. /etc/init.d/httpd restart
추가적으로 버츄얼호스트마다 도메인명으로 로그 생기게 해주면 더 좋음
vi /etc/httpd/conf/vhosts.conf
ErrorLog /var/log/httpd/도메인명.error_log
CustomLog /var/log/httpd/도메인명.access_log combined
'Apache' 카테고리의 다른 글
아파치 ip 허용/차단 (0) | 2016.07.07 |
---|---|
mod-pagespeed webp 엣지 이미지 깨짐 (0) | 2016.05.17 |
간단한 명령어로 아파치 순방문자 구하기 (0) | 2016.02.17 |
아파치 access_log 의미 (0) | 2016.01.04 |
웹 document root 접근시 다른 디렉토리로 redirect 하는 방법 (0) | 2016.01.04 |