AuthType Basic
AuthName "staging"
AuthUserFile "/etc/httpd/pass/password"
require valid-user
我看到这个,在 /etc/httpd/pass/password 里面
我懂了
example1:justanexample
example2:dasd
example3:notatruepass
当 Apache 请求用户名和密码时,这些凭据都不起作用。
答案1
根据手册,尝试使用以下命令生成密码文件:
# Delete plain text password file
rm /etc/httpd/pass/password
# Generate first user
htpasswd -c /etc/httpd/pass/password example1
# Type a password
# Do it again
htpasswd -c /etc/httpd/pass/password example2
htpasswd -c /etc/httpd/pass/password example3