First, basic certification:
(1) Define a security domain
<directory "" >
Options None
AllowOverride None
AuthType Basic
AuthName "STRING"
AuthUserFile "/path/to/httpd_user_passwd_file"
Require User username1 UserName2 ...
</Directory>
Allow all users in the account file to log in to access: Require Valid-user
(2) Provide account and password storage (text file) using HTPASSWD command to manage
htpasswd [Options] passwordfile username
-C: Automatically create passwordfile, so it should only be used when the first user is added;
-M:MD5 Encrypt user password;
-S:SHA1 Encrypt user password;
-D: Delete the specified user
(3) Implementation of group-based authentication
<directory "" >
Options None
AllowOverride None
AuthType Basic
AuthName "STRING"
AuthUserFile "/path/to/httpd_user_passwd_file"
AuthGroupFile "/path/to/httpd_group_file"
Require Group GROUP1 GROUP2 ...
</Directory>
To provide user account files and group files;
Group files: Each row defines a group grp_name:user1 user2 User3 ...
Second, each virtual host has a dedicated configuration:
You can disable a central host: Comment DocumentRoot
<virtualhost "Ip:port" >
Severname
DocumentRoot ""
</VirtualHost>
Serveralias: Alias of the virtual host;
Errorlog
Customlog
<directory "" >
......
</Directory>
Third, the built-in status page:
Can be placed within a single virtual host to query for individual virtual host status
<Location/server-status>
SetHandler Server-status
Order Deny,allow
Deny from all
Allow from 172.16
</Location>
#ExtendedStatus on extended built-in status page, closed by default
httpd2.2 (CENTOS6) Configuration authentication Landing page, based on document authentication (basic), virtual host-specific configuration and built-in status page configuration