Zyngalu: Block phpMyAdmin
Index | Home Server | My Hardware | Youtube Channel Art | Feedback | Mount USB Drive | Shut Down Pi | Forums

Ban Unwanted Log Ons onto phpMyAdmin

Protect phpmyadmin from unwanted log on attemps by banning all ip addresses except the ones you control.

Log onto your server and go to on the Raspberry PI

/etc/phpmyadmin/apache.conf

or other Linux systems

/etc/apache2/conf-available/phpmyadmin.conf

At the top of the page find

# phpMyAdmin default Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
    Options SymLinksIfOwnerMatch
    DirectoryIndex index.php 


       Add New Code Here


   Options SymLinksIfOwnerMatch

Add this code here. The IP address is the IP Address of the computer you want to have access to phpMyAdmin.

#Block Outside IP Addresses
    Order Deny,Allow
    Deny from All
    Allow from 192.168.0.121

Which gives you

# phpMyAdmin default Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
    Options SymLinksIfOwnerMatch
    DirectoryIndex index.php 


    #Block Outside IP Addresses
    Order Deny,Allow
    Deny from All
    Allow from 192.168.0.121


   Options SymLinksIfOwnerMatch

Restart Apache

sudo service apache2 restart