« krusader - Linux 下的 Total Commander |
Main
| stardict 星际译王 - Linux 下的金山词霸 »
August 30, 2004
.htaccess 的权限有效域 - .htaccess 所在目录
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本声明。
https://windtear.net/archives/2004/08/30/000315.html
犯了一个 .htaccess 的低级错误 其实不能算犯错 只是大脑某些地方出了问题 丢人了:(
apache 基于 .htaccess 的权限认证只对 .htaccess 所在目录有效 我的错误在于 我脑子里认为我放好了 .htaccess (事实上 静态页面目录我放了 cgi 目录没放我以为放过了)
死活查不出错在哪里 tail access_log 也只能发现"认证丢失" 按说这时就应该想到 .htaccess 忘放了 竟然还在脑子里yy 为啥呢 blog 一下作为纪念
-----> .htaccess AuthName "Test" AuthType Basic AuthUserFile /path/htpasswd.users require valid-user
-----> % htpasswd Usage: htpasswd [-cmdpsD] passwordfile username htpasswd -b[cmdpsD] passwordfile username password
htpasswd -n[mdps] username htpasswd -nb[mdps] username password -c Create a new file. -n Don't update file; display results on stdout. -m Force MD5 encryption of the password. -d Force CRYPT encryption of the password (default). -p Do not encrypt the password (plaintext). -s Force SHA encryption of the password. -b Use the password from the command line rather than prompting for it. -D Delete the specified user. On Windows, NetWare and TPF systems the '-m' flag is used by default. On all other systems, the '-p' flag will probably not work.
% htpasswd -b htpasswd.users windtear password htpasswd: cannot modify file htaccess; use '-c' to create it
% htpasswd -bc htpasswd.users windtear password Adding password for user windtear
% more htpasswd.users windtear:q2mV0NZp92R3g
% htpasswd -b htpasswd.users windtear2 password2 Adding password for user windtear2
% more htpasswd.users windtear:q2mV0NZp92R3g windtear2:1/sWcHqdfBK3A
|
|
Posted by windtear at August 30, 2004 11:06 AM