I'm disabling access to some folders to unauthorized users this way:
AuthUserFile /var/www/passwords/.htpasswd_private
AuthType Basic
AuthName "Access to private admin section"
Require valid-user
It works fine on the production (Ubuntu) server.
The problem is I want the same code to allow access (or at least ask for password) on a windows dev computer.
Tried adding
Allow from 127.0.0.1
But the logs show error because it cannot find the password file on the dev computer.
The system cannot find the path specified. : Could not open password file: C:/var/www/passwords/.htpasswd_private
Whats the elegant way to tell apache to either allow access or ask for password on the dev computer?
Best Answer
Create the directory
C:/var/www/passwords/.htpasswd_private
and then use thehtpasswd.exe
program that comes with your apache installation to create the.htpasswd_private
fileNow you should have a system works like your production server.