Selected from Linux Selected from PHP
- Ubuntu 17.10 Install google's mod pagespeed for apache - PHP-Ubuntu-Youtube-dl simple script for converting and downloading youtube video or mp3
- Ubuntu SSH tunnel via proxy - PHP while loop with every row with a different color
- Install GoAccess Apache Log Analyzer Tool on Ubuntu 17.10 - PHP use while loop in function
- SSHFS and map folder with a proxy - PHP List Files And Folders As links
- How to connect to SSH server with a proxy - PHP Extract Text From String
➥ Ubuntu 16.10/16.04/16.10 install phpmyadmin and add .htaccess password protection
Added by sonik on 08-05-2017 and keywords: htaccess, htpasswd, protect, phpmyadmin, apache2, password, directory [ Print Article ]


First install phpmyadmin
apt-get install phpmyadmin -y


now edit
pico /etc/apache2/conf-available/phpmyadmin.conf


and add at the bottom of the file
<Directory /usr/share/phpmyadmin>
   Options FollowSymLinks
   DirectoryIndex index.php
   AllowOverride All
</Directory>


now restart apache
sudo systemctl restart apache2


create the .htaccess file
pico /usr/share/phpmyadmin/.htaccess


and add
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/phpmyadmin/.htpasswd
Require valid-user


install if needed
sudo apt-get install apache2-utils -y


generate a user and a password
htpasswd -c /etc/phpmyadmin/.htpasswd username


if you want a secondary user
htpasswd /etc/phpmyadmin/.htpasswd additionaluser


now go to
http://yoursitename/phpmyadmin

You will be asked to enter your username and password before you see the php user and password panel.

@All rights reserved with Copyright Webleit.info 2018 by Sonik_Blast [ Site Map ] [ RSS ] [ YouTube Mp3 Downloader and converter ]