第一步:添加下面的代码到 /etc/apache2/sites-available/000-default.conf 或者 /etc/httpd/conf/httpd.conf Add these lines to the Apache configuration file (/etc/apache2/sites-available/000-default.conf or /etc/httpd/conf/httpd.conf): /etc/apache2/sites-available/000-default.conf – On Ubuntu <Directory /usr/share/phpmyadmin> AuthType Basic AuthName "Restricted Content" AuthUserFile /etc/apache2/.htpasswd # or/etc/phpmyadmin/.htpasswd Require valid-user </Directory> /etc/httpd/conf/httpd.conf – On CentOS <Directory /usr/share/phpmyadmin>… Read More