Centos8 server security advanced chapter (four user authentication)

Time:2021-5-11

Episode 4 Apache user authentication

1、 Generate htpasswd password file
/usr/local/apache/bin/htpasswd -c -b /websafe/.htpasswd user1 123
/usr/loocal/apache/bin/htpasswd -b /websafe/.htpasswd user2 123

2、 Apache configuration file
<Directory “/usr/local/apache/htdocs/bbs”>
Options None
Allowoverride authconfig # enable user authentication
AuthName “bbs.ityzm.com”
AuthType Basic
AuthUserFile /websafe/.htpasswd
require valid-user

3、 Apache master profile global authentication
<Directory “/usr/local/apache/htdocs”>
Options Indexes FollowSymLinks
AllowOverride AuthConfig
AuthName “bbs.ityzm.com”
AuthType Basic
AuthUserFile /websafe/.htpasswd
require valid-user

#Be sure to note that the child profile will override the settings in the main profile

This work adoptsCC agreementReprint must indicate the author and the link of this article

Recommended Today

Mongodb aggregate

  https://www.cnblogs.com/wt7018/p/11929359.html Mongodb aggregate   1、 Foundation 1. What is aggregation? Aggregation is an aggregation pipeline based on data processing. Each document passes through a pipeline composed of multiple stagesIt can group and filter the pipelines in each stage, and then output the corresponding results after a series of processing DB. Set name. Aggregate ({pipeline: […]