Date: 2013jan31
Product: Apache 2.4
Q. How can I setup Digest Authentication with Apache 2.4?
A.
Ensure .htaccess files are allowed - check your main .conf file:
<Directory /var/www>
AllowOverride AuthConfig
<Directory>
Put this in an .htaccess file:
AuthType Digest
AuthName myrealm
# AuthDigestDomain /here # Not needed
AuthDigestProvider file
AuthUserFile /etc/httpd/conf/mydigest
Require valid-user
Create the user file like this:
htdigest -c /etc/httpd/conf/mydigest myrealm myuser
And you'll be prompted for a password.
Things to note:
- The realm used in AuthName must match the realm on the htdigest command line.
- The file user file can be anywhere. But its not safe to put in your webtree.
- Can be in a .conf file rather than .htaccess