Apache 서버 헤더에서 PHP 버전 정보 숨기기
Apache의 웹서버의 버전 숨기는 것은 httpd.conf 에서 ServerTokens 지시자를 통해서 쉽게 설정할 수 있다.
하지만 이렇게 설정을 하더라도 웹서버 헤더에 'X-Powered-By: PHP/4.x.x'와 같이 PHP버전을 그대로 볼 수
있다.
$ telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
HEAD / HTTP/1.0
HTTP/1.1 200 OK
Date: Sun, 11 Apr 2004 15:17:10 GMT
Server: Apache
X-Powered-By: PHP/4.x.x (버전이 표시되는데 글 작성할 때 4.x.x로 수정했음)
Connection: close
Content-Type: text/html
Connection closed by foreign host.
그러면 어떻게 숨길까?
php.ini 파일에서
expose_php = On 를
expose_php = Off 로 바꾸고 웹서버를 재실행하면 된다.
$ telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
HEAD / HTTP/1.0
HTTP/1.1 200 OK
Date: Sun, 11 Apr 2004 15:17:10 GMT
Server: Apache
X-Powered-By: PHP/4.x.x (버전이 표시되는데 글 작성할 때 4.x.x로 수정했음)
Connection: close
Content-Type: text/html
Connection closed by foreign host.
그러면 어떻게 숨길까?
php.ini 파일에서
expose_php = On 를
expose_php = Off 로 바꾸고 웹서버를 재실행하면 된다.