컴퓨터/노트북/인터넷
IT 컴퓨터 기기를 좋아하는 사람들의 모임방
🕰️
2022.01.20 13:12
우분투 "Apache/2.4.41 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f (internal dummy connection)"
조회 수 184 추천 수 0 댓글 0
이 로그로 인해 Apache 가 정상적으로 응답하지 않는 현상도 발생한다
::1 - - [26/Mar/2020:16:10:30 +0900] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g (internal dummy connection)" ::1 - - [26/Mar/2020:16:10:31 +0900] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g (internal dummy connection)" ::1 - - [26/Mar/2020:16:10:32 +0900] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g (internal dummy connection)" ::1 - - [26/Mar/2020:16:10:33 +0900] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g (internal dummy connection)" ::1 - - [26/Mar/2020:16:10:35 +0900] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g (internal dummy connection)"
"Apache/2.4.41 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f (internal dummy connection)" 더미 연결 로그 생성방지 해결방법은 아래와같다
1. RewriteEngine 을 이용한 로그방지
You can use .htaccess by redirecting requests from the "internal dummy connection" to an empty file
RewriteEngine on RewriteCond %{HTTP_USER_AGENT} ^.*internal dummy connection.*$ [NC] RewriteRule ^/$ /empty.html [L]
2. apache2.conf 설정에서 donot을 이용한 로그방지
해결책
/etc/apache2/apache2.conf
/etc/apache2/sites-enabled
두곳을 손봐야한다
1. apache2.conf 검정 밑줄친 부분을 추가해준다 LogFormat " %v %>s %h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"" combined LogFormat "%h %l %u %t "%r" %>s %O" common LogFormat "%{Referer}i -> %U" referer LogFormat " %v %>s "%{User-agent}i" agent SetEnvIf Remote_Addr "127.0.0.1" dontlog SetEnvIf Remote_Addr "::1" dontlog SetEnvIf User-Agent ".*internal dummy connection.*" dontlog LogFormat " %v %>s "%{User-Agent}i"" vhost_combined 2. /etc/apache2/sites-enabled 호스트안에 ****.log로 구분하여 로그기록을 하도록 분리한다. <VirtualHost *:80> CustomLog ${APACHE_LOG_DIR}/*****.log combined env=!dontlog </VirtualHost>
참조 : https://cwiki.apache.org/confluence/display/HTTPD/InternalDummyConnection
https://allthatlinux.com/dokuwiki/doku.php?id=access_log%EC%97%90_options_http_1.0_%EA%B0%80_%EA%B8%B0%EB%A1%9D%EB%90%98%EB%8A%94_%EC%9D%B4%EC%9C%A0