0

I have protected my database PHPMYADMIN. I try to do like:

<Directory /usr/share/phpmyadmin>
    DirectoryIndex index.php
    Options Includes ExecCGI
    AllowOverride None
    Order deny,allow
    Deny From All
    Allow from 10.230.35.xx -> my IP
    Allow from 10.230.35.X2  -> additional IP it works
    Allow from 127.0.0.1

    <IfModule mod_php5.c>
            AddType application/x-httpd-php .php

            php_flag magic_quotes_gpc Off
            php_flag track_vars On
            php_flag register_globals Off
            php_admin_flag allow_url_fopen Off
            php_value include_path .
            php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
            php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/
    </IfModule>

But,my access was blocked even I allowed.Why? I am trying to add another IP, and it works but not for my IP.

8
  • Try adding this line: Order deny,allow
    – Alex
    Oct 10, 2013 at 7:42
  • Already, I put it before Deny From All but still same. do restart apache2 still same.
    – nunu
    Oct 10, 2013 at 7:44
  • 2
    You are relying on IP-based ACLs to protect youself from being compromised via phpmyadmin? The best thing to do, in a professional environment, is to get rid of that (and other web control panels) and learn SQL. Seriously. Oct 10, 2013 at 7:48
  • @FalconMomot:so, what is the best way?
    – nunu
    Oct 10, 2013 at 7:51
  • The best way is to get rid of it, and manage your DBMS using SQL and the SQL command line. Oct 10, 2013 at 7:53

1 Answer 1

1

Be aware that you will only be able to access this stuff over IPv4; if you end up using IPv6 somehow, it will deny you. If you have dynamic DNS updates in your environment, hosts supporting IPv6 will often register their IPv6 addresses and then prefer them and start communicating over IPv6 all on their own. See if that is the cause of your trouble.

Try looking at your access log and error log, and see what IP address is getting the 403 error that is being sent.

3
  • I have checked my network setting, my IP is in IPv4
    – nunu
    Oct 10, 2013 at 7:52
  • 1
    show [error] [client 136.198.117.xx] client denied by server configuration: /usr/share/phpmyadmin/.136.198.117.xx this is ip proxy for internet access in my office. but i couldn't access my phpmyadmin at 136.198.117.x.
    – nunu
    Oct 10, 2013 at 7:59
  • That'd do it. You should create exclusions for local addresses if you are using a proxy. Oct 10, 2013 at 8:45

Not the answer you're looking for? Browse other questions tagged .