Skip to content

Instantly share code, notes, and snippets.

@digitup
Created March 10, 2013 17:01
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digitup/5129422 to your computer and use it in GitHub Desktop.
Save digitup/5129422 to your computer and use it in GitHub Desktop.
Server - Secure phpMyAdmin
//install phpmyadmin
sudo apt-get install phpmyadmin
//After the installation has completed, add phpmyadmin to the apache configuration.
sudo nano /etc/apache2/apache2.conf
//add phpmyadmin to config file
Include /etc/phpmyadmin/apache.conf
//restart apache
sudo service apache2 restart
//security
//Set Up the .htaccess File
sudo nano /etc/phpmyadmin/apache.conf
//Under the directory section, add the line “AllowOverride All” under “Directory Index”, making the section look like this:
<Directory /usr/share/phpmyadmin>
Options FollowSymLinks
DirectoryIndex index.php
AllowOverride All
[...]
//Configure the .htaccess file
sudo nano /usr/share/phpmyadmin/.htaccess
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /path/to/passwords/.htpasswd
Require valid-user
//Create the htpasswd file
sudo htpasswd -c /path/to/passwords/.htpasswd username
sudo service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment