numeritos Apprentice
Joined: 24 Nov 2006 Posts: 154
|
Posted: Fri Mar 02, 2007 6:55 am Post subject: phpmyadmin access restriction |
|
|
First of all, I'll explain what I want to do. What I want is to restrict phpmyadmin access to, for example, an IP.
I read a lot before posting here and finally got the result I wanted, but I want to know anyway why some stuff didn't work at first.
What I did was editing /etc/phpmyadmin/config.inc.php and put these lines:
Code: | $cfg['Servers'][$i]['AllowDeny']['order'] = 'allow,deny';
$cfg['Servers'][$i]['AllowDeny']['rules'] = array('allow root from IP'); //I put the IP I wanted to grant access to phpmyadmin |
This didn't work and I really don't know why. I restarted apache2 to see if that helped, but it just didn't.
What I finally did was adding this to /etc/apache2/sites-enabled/000-default:
Code: | Alias /phpmyadmin/ "/usr/share/phpmyadmin/"
<Directory "/usr/share/phpmyadmin/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from IP/255.0.0.0 ::1/128 #I put the IP I wanted to grant access to phpmyadmin
</Directory> |
This worked, but what I want to know is why the first attempt didn't. |
|