Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

    <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/

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

share|improve this question

closed as off-topic by Falcon Momot, dawud, Jenny D, squillman, mdpc Oct 10 '13 at 17:28

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is a site dedicated to professionals; novice questions are off-topic. Please see the Help Center for more information on topicality. The best advice we can give you is to hire a professional to help you out." – Falcon Momot, dawud, Jenny D, squillman, mdpc
If this question can be reworded to fit the rules in the help center, please edit the question.

Try adding this line: Order deny,allow – Alex Oct 10 '13 at 7:42
Already, I put it before Deny From All but still same. do restart apache2 still same. – nunu Oct 10 '13 at 7:44
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. – Falcon Momot Oct 10 '13 at 7:48
@FalconMomot:so, what is the best way? – nunu Oct 10 '13 at 7:51
The best way is to get rid of it, and manage your DBMS using SQL and the SQL command line. – Falcon Momot Oct 10 '13 at 7:53
up vote 1 down vote accepted

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.

share|improve this answer
I have checked my network setting, my IP is in IPv4 – nunu Oct 10 '13 at 7:52
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 '13 at 7:59
That'd do it. You should create exclusions for local addresses if you are using a proxy. – Falcon Momot Oct 10 '13 at 8:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.