Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

apache basic auth setup

#install apache utilis
sudo apt-get install apache2 apache2-utils
#add apache user
sudo htpasswd -c /etc/apache2/.htpasswd some_username_here

#Setup Directory permissions in Apache Config
<Directory "/var/www/html">
	AuthType Basic
	AuthName "Restricted Content"
    AuthUserFile /etc/apache2/.htpasswd
    Require valid-user
</Directory>
#restart apache
sudo service apache2 restart
 
PREVIOUS NEXT
Tagged: #apache #basic #auth #setup
ADD COMMENT
Topic
Name
8+8 =