vi/usr/local/apache2/conf/extra/httpd-vhosts.conf
<Directory *>
AllowOverride AuthConfig
AuthName "自定义的"
AuthType Basic
AuthUserFile /data/.htpasswd
require valid-user
</Directory>
保存后,然后
创建apache的验证用户
/usr/local/apache2/bin/htpasswd-c /data/.htpasswd aming
密码:123456
时间: 2024-12-20 14:23:28