воскресенье, 24 августа 2014 г.

Разрешаем доступ к WEB-серверу Apache только с определенных сетей

1) Открываем конфигурационный файл Apache

2) Правим файл
Меняем блок
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

на

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 10.0.0.0/8
</Directory>


Затем меняем блок
<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
    Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
#    AllowOverride None
    AllowOverride All
#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all
</Directory>

на

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 10.200.0.0/16
</Directory>

3) Рестуртуем сервис Apache


Комментариев нет:

Отправить комментарий