Apache is a popular Web server that runs on linux, Unix, Windows, and other control systems. it can effectively solve the "user name + password" authentication title. There are two different storage methods for the user name and password required for Apache user authentication:
Apache is a popular Web server that runs on linux, Unix, Windows, and other control systems. it can effectively solve the "user name + password" authentication title. The username and password required for Apache user authentication are stored in two different ways: text files and databases such as MSQL, Oracle, and MySQL. The following uses Apache in Linux as an example to describe the two storage methods and briefly describe Apache user authentication in Windows. Next, let's take a look at the methods implemented through text authentication.
Three steps are required to establish user authentication and authorization:
1. create a user Library
2. configure the protection domain of the server
3. tell the server which users have access permissions for resources
Few blank talk examples are the most clear !~ Assume that user authentication is required for files in a directory such as/home/ftp/pub.
Create authenticated user
@htpasswd –c /*/.password xuanfei
Create an authentication group
@vi /*/.groupxuanfei-group:xuanfei xuanfei1
Basic Apache user authentication methods:
Enter the following line in httpd. conf.
<>options indexes followsymlinksallowoverride authconfigorder allow,denyallow from all<>
Or add/etc/httpd/conf. d/to create a configuration file named. conf.
〈Directory /home/ftp/pub>Options IndexesAllowOverride AuthConfigorder allow,denyallow from all〈/Directory>
Use it in the/home/ftp/pub directory to place the file. htaccess. the content is as follows:
Authname 'shared Files' authtype basicauthuserfile/*/. passwordrequire valid-user # require group xuanfei-group // receiving group so user # requirre user xuanfei // receive xuanfei single user
Use the program htpasswd along with Apache to generate the/etc/. passwd file. each line has one user name: password.