This article describes the implementation on Linux + Apache:
1, modify http.conf
Suppose you want to control different access to the directory under /usr/local/apache/htdocs Permissions, you can add a line between and:
AllowOverride All
means that the access permissions of different directories under /usr/local/apache/htdocs are made by the .htaccess file in that directory. To control, and the permission policies of different directories can be overwritten by each other.
2, edit the .htaccess file in the directory you want to control
Assuming your phpmyadmin directory is under /usr/local/apache/htdocs, you can create it in the phpmyadmin directory. A .htaccess file with the following contents:
AuthUserFile /usr/local/apache/pass/pwdPhp
AuthType Basic
AuthName "Database Security Zone"
ErrorDocument 401 /catchErrors/err_401.html
require valid-user
This file explains several issues:
(1) User information is stored in /usr/local/apache/pass/pwdPhp.
(2) The authentication type is basic (in addition to some other encryption types).
(3) The html file pointed to by ErrorDocument.
(4) Authentication method: user-authenticated (valid-user) or group-authenticated (valid-group).
3. Generate user Password file
There is a user password generator: htpasswd (under /usr/local/apache/bin), which can add user password information to the specified file, such as /u Sr/local/apache/pass/pwdPhp. My user password file contents are as follows:
admin:a0Hplbj33QjV2
guest:R0BYSO383QjVT
4. Restart apache deamon
/usr/local/apche/bin/apachectl restart
5. Test
Browse protected pages in IE, such as http://ip/phpmyadmin/(may need Refresh several times to work.) An authentication window should appear. You need to enter the username (admin /guest) and password (******) to access this page.
One Cancel Anonymous Access Function By default, the FTP server of Wi
In this article, we will work together to see how shortcuts can help users improve their productivit
Sometimes the following error occurs when opening the home page, ie http://localho
Windows operating system IIS is one of the most commonly used web servers. IIS is powerful and easy
IIS7/iis7.5 pseudo-static plus sign and space error solution
Proxy server some special types of applications
Check if the server is powered on
IIS prompt error ASP 0177 : 800401f3 Se
Service Unavailable solution after uninstalling ZkeysPHP
Considerations for server cluster high availability
IIS6.0 application pool recycling and working process
Windows2008 iis7 pseudo-static URL with special symbol space inaccessible solution
Five recommendations to improve the security of intranet servers
The IIS configuration file backdoor
Configure the WSUS server client computer for automatic update
How to use the system's own partitioning tool for disk partitioning
Solution for "Access Denied" when XP system is enabled for hibernation
How to use Win10 fingerprint recognition function? The
Windows XP system to find the MAC address problem
Win10 security mode can not create a new account how to do
What is the format of png? Png and gif format picture difference
Win8, privacy becomes a problem
How does Win7 recover deleted files in the recycle bin?