View Full Version : Password protecting a directory
JoeCD
11-25-1998, 10:53 PM
I know it has something to do with that .htaccess file... just have no idea what to put in it, other than this....
<Limit GET POST PUT>
require valid-user
</Limit>
Am I missing something?
Joe
To do this you need to create two files. Create an .htaccess file and put it in the directory you want to password protect. Inside the .htaccess file you need to add the following...
----------------------------
AuthUserFile /big/dom/xolivernews/.htpasswd
AuthGroupFile /dev/null
AuthName test
AuthType Basic
<LIMIT GET POST>
require valid-user
</Limit>
-----------------------------
AuthUserFile = the path to the password file that has access to the restricted directory
(NOTE: you probably don't want to place this file where people on the web can access it)
AuthName = the message people will be prompted with, such as, "Restricted Area." For some reason FutureQuest servers don't allow a space between words.
That's all you will really have to change.
Next you will need a password file. To do this Telnet into your account and go into the directory you want to place the password file in. Type in...
-----------------------------
htpasswd -c PASSWORD_FILE_NAME username
-----------------------------
PASSWORD_FILE_NAME = the file name that will hold the password (example: .htpasswd) In other words, AuthUserFile in .htaccess is the same as this.
username = the username that will have access to the restricted directory.
Once you are done hit enter and you will be asked to type in a password for the user name. Do that and then it will create a password file in the directory you are in.
Hope This Helps.
[This message has been edited by cngo (edited 11-26-98).]
Terra
11-26-1998, 10:26 PM
Hello,
An added note...
If you do not have a group file, then you don't have to add it...
The 'AuthGroupFile /dev/null' is not necessary anymore...
Also, I have found compatability problems with IE and Netscape in regards to the 'AuthName' with spaces in the name
AuthName "a long name"
doesn't really work very well... Instead use this:
AuthName a_long_name
This will make it compatible with both browsers...
Just my 2 cents...
--
Terra
sysAdmin
vBulletin® v3.6.8, Copyright ©2000-2009, Jelsoft Enterprises Ltd.