4

I am trying to use RequireAny to allow acces to a site from either a certain IP or with a certain username. However, when I try to run apache I get the following error:

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

The part of my apache file with authentication looks like this:

<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>

Why am I getting an error when using RequireAny in this case?

moesef
  • 255
  • 1
  • 2
  • 10

1 Answers1

5

The <RequireAny> and Require directives that you're trying to use were added in Apache 2.4 and are in the mod_authz_core module. They are not available in Apache 2.2.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940