要求任何apache2错误

我正在尝试使用RequireAny来允许从某个IP或某个用户​​名访问站点。 但是,当我尝试运行Apache,我得到以下错误:

Invalid command '<RequireAny', perhaps misspelled or defined by a module not included in the server configuration Action 'configtest' failed. 

我的身份validation的Apache文件的一部分看起来像这样:

 <Directory /var/www/web/> Options Indexes FollowSymLinks AllowOverride AuthConfig FileInfo Options AcceptPathInfo On AuthName "Protected Site" AuthType Basic AuthBasicProvider file AuthUserFile /etc/apache2/.htpasswd <RequireAny> Require user dev Require ip 71.198.111.188 </RequireAny> #Order allow,deny #allow from all </Directory> 

为什么在这种情况下使用RequireAny时会出现错误?

您尝试使用的<RequireAny>Require指令是在Apache 2.4中添加的,位于mod_authz_core模块中。 它们在Apache 2.2中不可用。