我正在尝试用密码保护文档根目录,但我得到的只是一个“内部服务器错误”页面。Apache 错误日志显示:
Invalid command 'AuthType', perhaps misspelled or defined by a module not included in the server configuration
Run Code Online (Sandbox Code Playgroud)
在任何重写条目之前我的 .htaccess 文件:
AuthType Basic
AuthName "Restricted Access"
AuthBasicProvider file
AuthUserFile /var/www/public/.htpasswd
Require user dean
Run Code Online (Sandbox Code Playgroud)
我检查了模块是否已启用:
Array (
[0] => core
[1] => mod_so
[2] => mod_watchdog
[3] => http_core
[4] => mod_log_config
[5] => mod_logio
[6] => mod_version
[7] => mod_unixd
[8] => mod_access_compat
[9] => mod_alias
[10] => mod_auth_basic
[11] => mod_authn_file
[12] => mod_authz_core
[13] => mod_authz_groupfile
[14] => …Run Code Online (Sandbox Code Playgroud)