Password Protecting a web site

Add the following to .htaccess:

CentOS:

AuthType Basic
AuthName “Restricted”
AuthUserFile /etc/httpd/htaccess-pass
Require valid-user
#Order deny,allow
#Deny from All
#Satisfy any

Create the file as follows:

htpasswd /etc/httpd/htaccess-pass username
You will then be prompted for a password

Ubuntu:

AuthType Basic
AuthName “Restricted”
AuthUserFile /etc/apache2/htaccess-pass
Require valid-user
#Order deny,allow
#Deny from All
#Satisfy any

Create the file as follows:

htpasswd /etc/apache2/htaccess-pass username
You will then be prompted for a password

 

About vicki

Welcome to the Sovereign Republic of Vickistan. I am the President here. Lucky me! No taxes or laws yet. Lucky you!
This entry was posted in Linux. Bookmark the permalink.