Archive for the ‘How to create .htpasswd’ Tag
How to create .htpasswd?
Filed under: Linux, php | Tags: apache, how to add password to site, How to create .htpasswd, site authorization, svlinux
Leave a Comment Create .htpasswd file from commandLine:
# htpasswd -c /var/www/html/.htpasswd sandeep
New password:
Re-type new password:
Updating password for user sandeep
Add these lines to .htaccess file
## ALLOW ACCESS WITH PASSWORD OR NO PASSWORD FOR SPECIFIC IP/HOSTS ###
AuthType basic
AuthName “Ooops! Temporarily Under Construction…”
AuthUserFile /var/www/html/.htpasswd
AuthGroupFile /dev/null
Require valid-user # password prompt for everyone else
Order Deny,Allow
Deny from all
Allow from 192.168.64.5 # Your, the developers IP address
Allow from w3.org # css/xhtml check jigsaw.w3.org/css-validator/
Allow from googlebot.com # Allows google to crawl your pages
Satisfy Any # no password required if host/ip is Allowed
http://www.askapache.com/online-tools/htpasswd-generator/
http://www.php.net/manual/en/features.http-auth.php
http://corz.org/serv/tricks/htaccess.php