htpasswd -c /home/lee/.htpasswd lee
b. 修改密码:
htpasswd /home/lee/.htpasswd lee
c. 增加用户:
htpasswd /home/lee/.htpasswd lee_01
d. 删除用户:
htpasswd -D /home/lee/.htpasswd lee
AuthType "Basic"
AuthName "Password Required" #提示文字
AuthUserFile "/home/lee/.htpasswd" #加密密码的文件
Require valid-user
auth_basic "请输入密码"
auth_basic_user_file /home/lee/.htaccess
原文:http://blog.51cto.com/12173069/2085963