The purpose of using the “distributed configuration file” .htaccess is so that users may control authentication. It can also be set in the Apache configuration file httpd.conf WITHOUT using the .htaccess file. This can improve server performance as the server will not have to look for the .htaccess file in each subdirectory.
<Directory /path/to/public_html/membersonly> AllowOverride AuthConfig AuthName "Add message visitors will see here. Keep Out!" AuthType Basic AuthUserFile /path/to/public_html/membersonly.htpasswd AuthGroupFile /dev/null require user name-of-user </Directory>
Require user is optional. There is a lot of good information about httpd.conf, .htaccess in a tutorial at this link. http://www.yolinux.com/TUTORIALS/LinuxTutorialApacheAddingLoginSiteProtection.html
Popularity: 19% [?]




