Linux Apache - 로그관리(rotatelogs,cronolog)
페이지 정보
작성자 서방님 댓글 0건 조회 214회 작성일 19-03-29 15:30본문
□ 기본 로그 경로 중지
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf .
.
177 # ErrorLog: The location of the error log file. 178 # If you do not specify an ErrorLog directive within a <VirtualHost> 179 # container, error messages relating to that virtual host will be 180 # logged here. If you *do* define an error logfile for a <VirtualHost> 181 # container, that host's errors will be logged there and not here. 182 # 183 #ErrorLog "logs/error_log" ( # 주석 처리 )
.
.
215 # If you prefer a logfile with access, agent, and referer information 216 # (Combined Logfile Format) you can use the following directive. 217 # 218 #CustomLog "logs/access_log" combined ( # 주석 처리 )
.
.
wq (저장)
□ rotation 셋팅
[root@localhost ~]# vi /etc/httpd/conf/vhost.conf
############### webtest11.com Start ############### <VirtualHost *:80> # ServerAdmin webmaster@dummy-host.example.com DocumentRoot /home/test ServerName webtest11.com ServerAlias www.webtest11.com ErrorLog "|/usr/sbin/rotatelogs /home/test/weblog/webtest11-error_log.%y%m%d 86400" ( 추가 또는 수정 ) CustomLog "|/usr/sbin/rotatelogs /home/test/weblog/webtest11-access_log.%y%m%d 86400" combined ( 추가 또는 수정 ) </VirtualHost> ############### webtest11.com End ################# ############### webtest22.com Start ############### <VirtualHost *:80> # ServerAdmin webmaster@dummy-host.example.com DocumentRoot /home/test2 ServerName webtest22.com ServerAlias www.webtest22.com ErrorLog "|/usr/sbin/rotatelogs /home/test2/weblog/webtest22-error_log.%y%m%d 86400" ( 추가 또는 수정 ) CustomLog "|/usr/sbin/rotatelogs /home/test2/weblog/webtest22-access_log.%y%m%d 86400" combined ( 추가 또는 수정 ) </VirtualHost> ############### webtest11.com End #################
관련링크 (출처)
- https://aeac.tistory.com/24 93회 연결
댓글목록
등록된 댓글이 없습니다.