apache的认证

简介:
实现访问 /usr/local/apache/htdocs/123 时,需要输入用户名和密码来验证

1. 修改 httpd.conf
添加如下内容
<Directory "/usr/local/apache/htdocs/11">

AuthName "please insert the password!!!"

AuthType basic

AuthUserFile /usr/local/apache/htdocs/11/.htpasswd

require valid-user

</Directory>

2. 用下面的命令来生成这个用户( web );它会提示你输入密码,即访问该目录时需要的密码

/usr/local/apache/bin/htpasswd -c /usr/local/apache/htdocs/11/.htpasswd  web

(注意:第一次运行该命令时用 -c  即建立)


本文转自 gehailong 51CTO博客,原文链接:http://blog.51cto.com/gehailong/263900,如需转载请自行联系原作者
相关文章
|
27天前
|
移动开发 Linux Apache
apache 用户登录认证
在Redhat 9系统中,已安装Apache服务。遵循教程,首先创建用户&quot;DL&quot;并设置密码,然后创建用户目录/home/DL/public_html,存放index.html。启用Apache的userdir模块,取消UserDir disabled的注释,并重启服务。通过htpasswd创建用户认证文件,编辑userdir.conf添加权限设置,包括AllowOverride、authuserfile、authname、authtype和require user。最后,通过浏览器访问ip/~DL/进行测试,实现用户登录验证。
15 4
|
XML 存储 缓存
Spring认证中国教育管理中心-Apache Geode 的 Spring 数据教程一
Spring认证中国教育管理中心-Apache Geode 的 Spring 数据教程一
|
存储 XML NoSQL
Spring认证中国教育管理中心-Apache Cassandra 的 Spring 数据教程十
Spring认证中国教育管理中心-Apache Cassandra 的 Spring 数据教程十
|
NoSQL 安全 Java
Spring认证中国教育管理中心-Apache Cassandra 的 Spring 数据教程六
Spring认证中国教育管理中心-Apache Cassandra 的 Spring 数据教程六
|
存储 XML 缓存
Spring认证中国教育管理中心-Apache Cassandra 的 Spring 数据教程四
Spring认证中国教育管理中心-Apache Cassandra 的 Spring 数据教程四
|
存储 NoSQL 安全
Spring认证中国教育管理中心-Apache Cassandra 的 Spring 数据教程四
Spring认证中国教育管理中心-Apache Cassandra 的 Spring 数据教程四
|
NoSQL Apache 数据库
9.25直播预告|如何0基础获得Apache Cassandra Administrator国际认证?
本次技术直播将为您分享如何0基础获得Cassandra Administrator国际认证的考试经验。
1250 0
9.25直播预告|如何0基础获得Apache Cassandra Administrator国际认证?
|
Apache
权限认证框架之Apache Shiro
1介绍 Shiro 架构图
1016 0
|
应用服务中间件 PHP Apache