vi/usr/local/apache2/conf/extra/httpd-vhosts.conf

<Directory *>

           AllowOverride AuthConfig

           AuthName "自定义的"

           AuthType Basic

           AuthUserFile /data/.htpasswd               

           require valid-user

</Directory>

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


保存后,然后
创建apache的验证用户

/usr/local/apache2/bin/htpasswd-c /data/.htpasswd aming 

密码:123456




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



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



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


验证:

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


转载于:https://blog.51cto.com/68686789/1834266

相关文章:

  • 2021-12-05
  • 2022-12-23
  • 2021-11-23
  • 2022-01-13
猜你喜欢
  • 2021-12-23
  • 2021-10-26
  • 2022-02-27
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案