【发布时间】:2014-07-08 10:41:13
【问题描述】:
这里我想保护需要用户名和密码才能访问的网站目录..
我在同一目录中创建了 .htaccess 文件..
AuthName "Member's Area Name"
AuthUserFile /path/to/password/file/.htpasswd
AuthType Basic
require valid-user
这里是我的 .htpasswd 文件在同一目录中
username:encryptedpassword
fred_smith:oCF9Pam/MXJg2
所以我的问题是如何在上面的字段'encryptedpassord' 中设置我自己的自定义密码,因为我读过我们不能只是弥补密码,在 Unix/Linux 服务器上,它们必须由服务器加密,在 Windows 服务器上你可以只需使用纯文本密码,因为 Windows 不提供任何加密方法
有什么方法可以设置自己的自定义密码吗?
【问题讨论】:
-
这里回答了这个问题。 stackoverflow.com/questions/5229656/…
标签: php apache .htaccess webserver .htpasswd