3

I'm setting up a development server and need to apply these basic rules to all virtual hosts on the server in the /var/www/html directory.

AuthType Basic
AuthName "Development Area"
AuthUserFile /var/www/.htpasswd
Require valid-user

I simply tried to put it in my httpd.conf, However apache throws an error when checking the syntax: AuthType not allowed here

Dunhamzzz
  • 187

1 Answers1

5

Authentication always applies to a context; this may be a VirtualHost, a Directory, or a Location.

<Location />
    AuthType Basic
    AuthName "Development Area"
    AuthUserFile /var/www/.htpasswd
    Require valid-user
</Location>
adaptr
  • 16,746