.htaccess URL身份验证在使用Amazon Linux AMI的Apcahe2.4版本上不起作用

.htaccess URL身份验证在使用Amazon Linux AMI的Apcahe2.4版本上不起作用,.htaccess,mod-rewrite,apache2.4,connect-modrewrite,urlauthenticationchallenges,.htaccess,Mod Rewrite,Apache2.4,Connect Modrewrite,Urlauthenticationchallenges,Apache 2.4版本配置文件是通过“mod_rewrite”模块启用的 身份验证模块加载并共享命令的输出:apachectl-M | grep'auth' auth_basic_module (shared) auth_digest_module (shared) authn_file_module (shared) authn_anon_module (shared) authn_dbm_module (shared) authz_host_module (shared) authz_us

Apache 2.4版本配置文件是通过“mod_rewrite”模块启用的

身份验证模块加载并共享命令的输出:apachectl-M | grep'auth'

auth_basic_module (shared)
auth_digest_module (shared)
authn_file_module (shared)
authn_anon_module (shared)
authn_dbm_module (shared)
authz_host_module (shared)
authz_user_module (shared)
authz_owner_module (shared)
authz_groupfile_module (shared)
authz_dbm_module (shared)
authnz_ldap_module (shared)
authz_core_module (shared)
在apache2.4中-应用程序目录的Web服务器配置文件

 <Directory /var/www/html/logfile>
 AllowOverride AuthConfig
 Require all granted
 </Directory>
通过url访问日志文件时,它必须请求url身份验证,成功验证后,它将允许查看该文件

但是它将生成500-内部服务器错误并共享apache服务器日志


.htaccess:命令“AuthType”无效,可能拼写错误或由服务器配置中未包含的模块定义

以下模块需要在Apache 2.4上启用url身份验证

LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_core_module modules/mod_authz_core.so
其他支持模块-认证相关

LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so