34323 发表于 2016-8-5 09:32:32

LAMP_为某个虚拟主机配置用户认证

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










验证:

页: [1]
查看完整版本: LAMP_为某个虚拟主机配置用户认证