RequireAny apache2 错误

moe*_*sef 4 mod-auth apache-2.2

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

Invalid command '<RequireAny', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
Run Code Online (Sandbox Code Playgroud)

我的带有身份验证的 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>
Run Code Online (Sandbox Code Playgroud)

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

Mic*_*ton 5

您尝试使用的<RequireAny>andRequire指令已添加到 Apache 2.4 中并且位于mod_authz_core模块中。它们在 Apache 2.2 中不可用。