RSS

How to create .htpasswd?

13 Nov

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

Advertisements
 
Leave a comment

Posted by on November 13, 2008 in Linux, php

 

Tags: , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: