Wednesday, November 18, 2015

Forbidden :You don't have permission to access /phpmyadmin on this server

 http://stackoverflow.com/questions/23235363/forbidden-you-dont-have-permission-to-access-phpmyadmin-on-this-server

Hi I have installed phpmyadmin on my centos machine and when I try to hit phpmyadmin through my browser I get this error :
Forbidden
You don't have permission to access `phpmyadmin` on this server.
My phpmyadmin.conf file has following content:
# 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>
Kindly help me resolve this issue. Any lead is appreciated.
Thanks

Answer :////////////////////

Edit disini : /etc/httpd/conf.d/phpMyAdmin.conf

You need to follow the following steps:
Find line that read follows
Require ip 127.0.0.1
Replace with your IP address you check using IP Checker:
Require ip 10.1.3.53
Again find the following line:
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... <<-- Tidak perlu dilakukakn

Save and close the file.Restart Apache httpd server:
# service httpd restart


restartnya bisa pakai https://dmainmuyang adawebmin.com:10000/shell/index.cgi