Apache : Скрываем информацию о версии - повышаем безопасность web сервера

Один из способов улучшения безопасности сервера - за счет сокрытия информации о версии серверного программного обеспечения.

Скрыть версию Apache


Достатоно изменить несолько параметров, а именно:
#
# ServerTokens
# This directive configures what you return as the Server HTTP response
# Header. The default is 'Full' which sends information about the OS-Type
# and compiled in modules.
# Set to one of:  Full | OS | Minor | Minimal | Major | Prod
# where Full conveys the most information, and Prod the least.
#
ServerTokens Major

#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory.
# listings, mod_status and mod_info output etc., but not CGI generated.
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of:  On | Off | EMail
#
ServerSignature Off


Скрыть X-Powerd-By


Заголовок X-Powerd-By в ответе веб сервера показывает совсем не безопасную информацию, а именно полную версию PHP.

Прячется всё он очень просто - достаточно изменить один параметр  в файле php.ini
; Decides whether PHP may expose the fact that it is installed on the server
; (e.g. by adding its signature to the Web server header).  It is no security
; threat in any way, but it makes it possible to determine whether you use PHP
; on your server or not.
expose_php = Off

Проверить


так же просто - телнетимся на сервер и даём команду HEAD / HTTP/1.0
получаем, типа-того:
# telnet localhost 80
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
HEAD / HTTP/1.0

HTTP/1.1 200 OK
Date: Sun, 26 Feb 2012 13:08:59 GMT
Server: Apache/2
Set-Cookie: PHPSESSID=bh1jl5eeb8cft0o4ph8g4s5c45; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Connection: close
Content-Type: text/html

Connection closed by foreign host.


Вы только посетили наш сайт, КОММЕНТИРОВАНИЕ будет доступно через несколько минут.
возможно у Вас отключен javascript, если включен - просто обновите страницу
наступна стаття:   HTML » Мета тег Cache-Control