cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak
vim /etc/httpd/conf/httpd.conf
<Directory "/node6-data1/bin/webs">
#添加下面一行到
Allowoverride authconfig
#拒绝所有访问
<Directory >
到 网页目录
cd /node6-data1/bin/webs/worklog
vim .htpasswd
AuthName "sys"
AuthType basic
AuthUserFile /node6-data1/bin/webs/worklog/.htpasswd
require valid-user
参考
https://www.linuxidc.com/Linux/2017-05/143314.htm
https://blog.csdn.net/alexander_phper/article/details/52242474