Recent Comments
변군이글루
[Apache] 아파치 액세스 로그 설정 본문
아파치 액세스 로그 설정
아파치 설정(httpd.conf) 편집 - vcombined 추가
$ vim /usr/local/apache2/conf/httpd.conf
...
<IfModule log_config_module>
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t %v:%p \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %Ts %Dμs" vcombined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
# You need to enable mod_logio.c to use %I and %O
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
...
가상호스트(httpd-vhosts.conf) 편접
$ vim /usr/local/apache2/conf/extra/httpd-vhosts.conf
...
CustomLog "|/usr/sbin/cronolog /logs/access/test.sangchul.kr-%Y%m%d.log" vcombined
ErrorLog "|/usr/sbin/cronolog /logs/error/test.sangchul.kr-%Y%m%d.log"
...
로그 확인
$ tail -f test.sangchul.kr-20201215.log
10.10.10.10 - - [15/Dec/2020:14:42:28 +0900] test.sangchul.kr:80 "GET /index.html HTTP/1.1" 200 55 "-" "curl/7.61.1" 0s 5475μs
'* 리눅스' 카테고리의 다른 글
[HP] HP 서버 스토리지 정보 확인 (0) | 2020.12.16 |
---|---|
[명령어] nc 명령어 (0) | 2020.12.15 |
[Apache] 아파치 액세스 로그 설정 (0) | 2020.12.15 |
[Apache] apache 다운로드 대역폭 속도 제한 (1) | 2020.12.15 |
[리눅스] rsync에서 ssh를 사용하여 파일 복사 (1) | 2020.12.14 |
[linux] Fabric 라이브러리 설치 (0) | 2020.12.14 |
0 Comments