Creating basic authentication for a web application with apache web server
in the application’s home directory create a .htpasswd file
# htpasswd -c .htpasswd <username>
then create .htaccess file like following
AuthUserFile /var/www/html/.htpasswd ##change path with yours
AuthType Basic
AuthName "popup box title"
require valid-user
You may need to edit virtual directory in the httpd.conf file
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
Comments
Post a Comment