【#文档大全网# 导语】以下是®文档大全网的小编为您整理的《Apache用户身份验证》,欢迎阅读!

1 vi /etc/httpd/conf/httpd.conf
Alias /acltest ”/acltest” #注:路径 “/acltest”>
Options Indexes MultiViews AllowOverride AuthConfig Order allow, deny Allow from all
2 mkdir /acltest chown apache acltest chgrp apache acltest chmod 500 acltest 3 vi /acltest/index.html
11111111111111
vi /acltest/.htaccess
AuthUserFile /apachepasswd/.htpasswd AuthName ”My secret directory” AuthType Basic
# Require valid-user #注:所有用户 Require user webuser1(用户名)
# Require group managers(组名)
# group1 : user1 user2 user3 4
mkdir /apachepasswd
chown apache apachepasswd chgrp apache apachepasswd chmod 500 apachepasswd
5 htpasswd –c /apachepasswd/.htpasswd webuser1(登录用户) new password: re-type new password:
htpasswd /apachepasswd/.htpasswd webuser2 6 chmod 444 .htpasswd chmod 444 .htaccess
说明:1 用户webuser1访问主页时,要进行身份认证 2 DocumcentRoot 要指向/htaccess
本文来源:https://www.wddqxz.cn/bea48a5b01768e9951e79b89680203d8ce2f6a80.html