Запрещенный: у Вас нет разрешения получить доступ к/phpmyadmin на этом сервере

Привет я установил phpmyadmin на своей машине песней и когда я пытаюсь совершить нападки phpmyadmin через мой браузер я получаю эту ошибку:

Forbidden
You don't have permission to access `phpmyadmin` on this server.

Мой phpmyadmin.conf файл имеет после содержания:

# phpMyAdmin - Web based MySQL browser written in php
# 
# Allows only localhost by default
#
# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin


<Directory /usr/share/phpMyAdmin/>
   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require ip 127.0.0.1
       Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from ::1
   </IfModule>
</Directory>

<Directory /usr/share/phpMyAdmin/setup/>
   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require ip 127.0.0.1
       Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from ::1
   </IfModule>
</Directory>

# These directories do not require access over HTTP - taken from the original
# phpMyAdmin upstream tarball
#
<Directory /usr/share/phpMyAdmin/libraries/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/lib/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/frames/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

# This configuration prevents mod_security at phpMyAdmin directories from
# filtering SQL etc.  This may break your mod_security implementation.
#
#<IfModule mod_security.c>
#    <Directory /usr/share/phpMyAdmin/>
#        SecRuleInheritance Off
#    </Directory>
#</IfModule>

Любезно помогите мне решить этот вопрос. Любой вывод ценится.

Спасибо

57
задан 23 April 2014 в 09:20

2 ответа

Установка Centos 7 php идет с пакетом ModSecurity, установленным и включенным, который предотвращает веб-доступ к phpMyAdmin. В конце phpMyAdmin.conf необходимо найти

# This configuration prevents mod_security at phpMyAdmin directories from
# filtering SQL etc.  This may break your mod_security implementation.
#
#<IfModule mod_security.c>
#    <Directory /usr/share/phpMyAdmin/>
#        SecRuleInheritance Off
#    </Directory>
#</IfModule>

, который дает Вам решение проблемы. Путем добавления

    SecRuleEngine Off

в блоке "Каталог,/usr/share/phpMyAdmin /", можно решить 'запрещенный доступ' к phpmyadmin, но можно создать проблемы безопасности.

0
ответ дан 1 November 2019 в 15:26

Находят Ваш IP-адрес и замену, где когда-либо Вы видите 127.0.0.1 с Вашим IP-адресом рабочей станции, Вы добираетесь из ссылки выше.

. . .
Require ip your_workstation_IP_address
. . .
Allow from your_workstation_IP_address
. . .
Require ip your_workstation_IP_address
. . .
Allow from your_workstation_IP_address
. . .

и в конце не забывают перезапускать сервер

sudo systemctl restart httpd.service
0
ответ дан 1 November 2019 в 15:26

Другие вопросы по тегам:

Похожие вопросы: