2

I want to password the directory /rutorrent on my website. In that directory, I've created this .htaccess file:

AuthUserFile /home/whitey/sites/localhost/.htpasswd
AuthName "Login to use rutorrent"
AuthType Basic

require valid-user

And then I have a .htpasswd file in /home/whitey/sites/localhost/:

whitey:f9kK77E4scRcI

I've generated the password using an online .htpasswd generator. I've restarted Apache, but when I go to the /rutorrent directory, I'm not prompted for a password.

Nothing shows up in the error logs, either.

James Linton
  • 347
  • 2
  • 4
  • 7

1 Answers1

2

In order for Apache to use your .htaccess file, the base configuration must specify that you're allowed to override the configuration using the AllowOverride directive. Further, the appropriate type of override must be allowed. For Auth* and Require directives, you must have at the minimum (you can have other options in the list too, or All):

AllowOverride AuthConfig

set for the <Directory> the .htaccess file is in (or a directory above it, with no other directory disabling the directive)

DerfK
  • 19,313
  • 2
  • 35
  • 51