In order to protect a directory on an Apache HTTPD web server with a password, this configuration was added to an .htaccess file in the respective directory:

AuthType Basic
AuthName "Protected Directory"
AuthUserFile /var/www/dir/ .htpasswd
Require valid-user

Furthermore, a file /var/www/dir/ .htpasswd was created with the following content:


Given that all these files were correctly processed by the web server processes, which of the following statements is true about requests to the directory?

A. The user usera can access the site using the password S3cr3t
B. Accessing the directory as usera raises HTTP error code 442 (User Not Existent)
C. Requests are answered with HTTP error code 500 (Internal Server Error)
D. The browser prompts the visitor for a username and password but logins for usera do not seem to work
E. The web server delivers the content of the directory without requesting authentication








而「Require」設定為「valid-user」的話,任何存在於「.htpasswd」檔案中的使用者才可以透過提供正確的密碼來存取檔案資源。如果使用者密碼驗證失敗的話,會回傳HTTP的401狀態(Authorization Required)。