分享

Apache web server certificate authentication

 Jeln 2009-09-27
1. 创建password.
   一般把password放在Apache Server上。
   在Apache目录下创建user文件夹.
   用htpasswd创建password.
   >cd "c:\Program Files\Apache Group\Apache2\bin"
   >htpasswd -bc ..\user\password.txt user test
  此命令在user文件夹中创建一个本文文件password.txt,并且创建了一个用户名user和密码test
   如果想要继续添加用户名和密码:>htpasswd -b ..\user\password.txt user1 test
2. 修改Apache配置文件.
    打开conf/httpd.conf,在文件最后添加:
   <Directory "要验证的文件目录">
       Options Indexes FollowSymLinks
       Allowoverride authconfig
       Order allow,deny
       Allow from all
 
       AuthName "Ironman Data API"
       AuthType Basic
       AuthUserFile "C:/Program Files/Apache Group/Apache2/user/password.txt"
       require valid-user
</Directory>
3. 重新启动Apache Server.
 

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多