Browse - Computer Tips - How can I setup Basic Authentication with Apache 2.4?
Product: Apache 2.4
Q. How can I setup Basic Authentication with Apache 2.4?
Ensure .htaccess files are allowed - check your main .conf file:
Put this in an .htaccess file:
require user myuser
Create the user file like this:
htpasswd -c /etc/httpd/conf/passwd myuser
And you'll be prompted for a password.
Things to note:
- 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