아파치 HTTP 헤더정보 설정(아파치,php 버전 노출 설정)

  • 아파치 설정 중 “ServerTokens” 옵션을 변경
    • 지원 옵션 : Full, OS, Minimal, Minor, Major, Prod
  • 확인 방법 : Telnet으로 httpd 포트 접속 후 헤더확인 값 입력
[root@sv ~]# telnet localhost 80
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
HEAD / HTTP/1.0

HTTP/1.1 200 OK
Date: Thu, 17 Mar 2016 00:17:34 GMT
Server: Microsoft-IIS/5.0
X-Powered-By: PHP/5.3.29
Cache-Control: max-age=3, must-revalidate
Expires: Thu, 17 Mar 2016 00:17:37 GMT
Vary: Accept-Encoding,Cookie
Connection: close
Content-Type: text/html; charset=UTF-8

Connection closed by foreign host.
  • 옵션별 출력 내용
    • ServerTokens Full
HTTP/1.1 400 Bad Request
Date: Wed, 16 Mar 2016 04:39:38 GMT
Server: Apache/2.4.18 (Unix) PHP/5.5.33
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1
  • ServerTokens OS
HTTP/1.1 400 Bad Request
Date: Wed, 16 Mar 2016 04:41:01 GMT
Server: Apache/2.4.18 (Unix)
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1
  • ServerTokens Minor
HTTP/1.1 400 Bad Request
Date: Wed, 16 Mar 2016 04:41:52 GMT
Server: Apache/2.4
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1
  • ServerTokens Minimal
HTTP/1.1 400 Bad Request
Date: Wed, 16 Mar 2016 04:42:29 GMT
Server: Apache/2.4.18
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1
  • ServerTokens Major
HTTP/1.1 400 Bad Request
Date: Wed, 16 Mar 2016 04:42:58 GMT
Server: Apache/2
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1
  • ServerTokens Prod
HTTP/1.1 400 Bad Request
Date: Wed, 16 Mar 2016 04:43:33 GMT
Server: Apache
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1

AH00534: httpd: Configuration error: No MPM loaded.

AH00534: httpd: Configuration error: No MPM loaded.

아파치 2.4에서 MPM 모듈 로딩 설정이 안되어 있을 경우.
httpd.conf 파일에서 다음 내용 확인하여 필요한 방식의 모듈을 주석 제거.

#LoadModule mpm_event_module modules/mod_mpm_event.so
#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_worker_module modules/mod_mpm_worker.so

AH00548: NameVirtualHost has no effect and will be removed in the next release

AH00548: NameVirtualHost has no effect and will be removed in the next release /usr/local/apach

아파치 2.4 이전 버전에서 가상호스트 설정시 가장 먼저 선언하던 “NameVirtualHost” 구문이 더 이상 효과가 없고, 다음 릴리즈에서는 제거될 예정이다라는 단순 경고 메시지. 실제 아파치 실행에는 문제가 없음
가상호스트 설정 내용중에서 NameVirtualHost *:80과 같은 구문을 주석처리할 경우 메시지가 사라지는 것을 확인할 수 있다.