AuthUserFile /server/path/to/.htpasswd AuthName "Login and Password Required" AuthType Basic require valid-user
You then have to create the .htpasswd file:
htpasswd -c /path/to/where/you/want/it/.htpasswd username
This will then prompt you to set the password for that username as a part of the file creation.
Best to have it a level above where the .htaccess file is for security reasons and make sure that the permissions are 644.
chmod 644 filename
In the httpd.conf - in apache2 probably /etc/apache2/sites-enabled/000-default - within the
If you get a message "Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a module not included in the server configuration" then run the following command:
sudo a2enmod rewrite
No comments:
Post a Comment