1) You can do this at the web server level.
Use allow / deny rules for apache. If you do not have direct access to your apache configuration file, you can use the .htaccess file.
<Directory /docroot>
Order Deny,Allow
Deny from all
Allow from 10.1.2.3
</Directory>
2) , phpmyadmin.
: $cfg['Servers'][$i]['AllowDeny']['rules']
:
'all' -> 0.0.0.0/0
'localhost' -> 127.0.0.1/8
'localnetA' -> SERVER_ADDRESS/8
'localnetB' -> SERVER_ADDRESS/16
'localnetC' -> SERVER_ADDRESS/24
phpMyAdmin.
http://www.phpmyadmin.net/documentation/#servers_allowdeny_order