금지됨 :이 서버에서 / phpmyadmin에 액세스 할 수있는 권한이 없습니다.
안녕하세요 저는 centos 컴퓨터에 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>
이 문제를 해결하도록 도와주세요. 모든 단서는 감사합니다.
감사
위의 구성 중 어느 것도 CentOS 7 서버에서 작동하지 않았습니다. 몇 시간 동안 검색 한 후 저에게 효과적이었습니다.
phpMyAdmin.conf 파일 편집
sudo nano /etc/httpd/conf.d/phpMyAdmin.conf
그리고 이것을 상단에서 교체하십시오.
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
#Require ip 127.0.0.1
#Require ip ::1
Require all granted
</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>
CENTOS7에 새로 설치할 때 위의 방법을 시도했지만 (phpMyAdmin.conf를 편집하고 Require all grant를 추가) 여전히 작동하지 않습니다. 해결책은 다음과 같습니다. mod_php 모듈을 설치합니다.
$ sudo yum install php
그런 다음 httpd를 다시 시작하십시오.
$ sudo systemctl restart httpd
그리고 짜잔!
다음 단계를 따라야합니다.
다음과 같은 줄 찾기
Require ip 127.0.0.1
워크 스테이션 IP 주소로 바꿉니다.
Require ip 10.1.3.53
다시 다음 줄을 찾으십시오.
Allow from 127.0.0.1
Replace as follows:
Allow from 10.1.3.53
Also find deny from all
and comment it in the entire file.
Save and close the file.Restart Apache httpd server
:
# service httpd restart
Edit file: sudo nano /etc/httpd/conf.d/phpMyAdmin.conf
and replace yours with following:
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
</IfModule>
</Directory>
Restart Apache: service httpd restart
(phpMyAdmin v4.0.10.8)
The problem with the answer with the most votes is it doesn't explain the reasoning for the solution.
For the lines Require ip 127.0.0.1
, you should instead add the ip address of the host that plans to access phpMyAdmin from a browser. For example Require ip 192.168.0.100
. The Require ip 127.0.0.1
allows localhost access to phpMyAdmin.
Restart apache (httpd) after making changes. I would suggest testing on localhost, or using command line tools like curl to very a http GET works, and there is no other configuration issue.
To allow from all:
#Require ip 127.0.0.1
#Require ip ::1
Require all granted
First edit the file /etc/httpd/conf.d/phpMyAdmin.conf and add the additional line to the directory settings:
<Directory /usr/share/phpMyAdmin/>
order deny,allow
deny from all
allow from 127.0.0.1
allow from 192.168.1.0/15
</Directory>
If you wanted to allow access to everybody then you could just change it to:
<Directory /usr/share/phpMyAdmin/>
order allow,deny
allow from all
</Directory>
Allow in all sections of the file.
A restart (service httpd restart) is enough to pick this up.
I found this after 2 days rigorous research, (find it here) and worked just right for me.
You could simply go to phpmyadmin.conf file and change "deny from all" to "allow from all". Well it worked for me, hope it works for you as well.
Centos 7 php install comes with the ModSecurity package installed and enabled which prevents web access to phpMyAdmin. At the end of phpMyAdmin.conf, you should find
# 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>
which gives you the answer to the problem. By adding
SecRuleEngine Off
in the block "Directory /usr/share/phpMyAdmin/", you can solve the 'denied access' to phpmyadmin, but you may create security issues.
Find your IP address and replace where ever you see 127.0.0.1 with your workstation IP address you get from the link above.
. . .
Require ip your_workstation_IP_address
. . .
Allow from your_workstation_IP_address
. . .
Require ip your_workstation_IP_address
. . .
Allow from your_workstation_IP_address
. . .
and in the end don't forget to restart the server
sudo systemctl restart httpd.service
ReferenceURL : https://stackoverflow.com/questions/23235363/forbidden-you-dont-have-permission-to-access-phpmyadmin-on-this-server
'Development Tip' 카테고리의 다른 글
onClick이 자식과 함께 LinearLayout에서 트리거되지 않았습니다. (0) | 2020.12.26 |
---|---|
WINDOWS RESTful 서비스의 cURL POST 명령 줄 (0) | 2020.12.26 |
설치된 코코아 포드의 버전을 확인하는 방법은 무엇입니까? (0) | 2020.12.26 |
JavaScript 런타임을 찾을 수 없습니다. (0) | 2020.12.26 |
순수한 Javascript를 사용하여 HTML 요소의 크기를 조정하는 방법은 무엇입니까? (0) | 2020.12.26 |