Thursday, December 4, 2008

Creating .htaccess

Go to folder were you want to create .htaccess
1. vim .htaccess

Type

AuthName " This is Restricted"
AuthType Basic
AuthUserFile /etc/httpd/.htpasswd
require user username

Creating htpasswd

htpasswd -mc /etc/httpd/.htpasswd username
Newpasswd:*****

2 comments:

pradeep said...

require Valid-user -> this would be wrong buddy.bcos u are creating all users in a single .htaccess file and when asked for username and password if we give any of the user name and password it will work .
so its should be like this

require user newslet

username for tht particular folder

rakesh said...

thx pradeep for mentioning the mistake i have changed it

curl and cacert

curl -v --cacert cacert.pem https://www.example/cgi-bin/f ile.xgi -I -X POST