
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