### *** IMPORTANT *** ###
When you up-laod this cgi to your server,
use ASCII mode. NOT binary! or you will
get and error.
### *** *** ###
1. Configure the adduser.pl and the login.pl (see below) 2. Send the files to your server, in ASCII mode. 3. On Unix, Chmod the cgi's to 755 or rwx-rx-rx (read-write-execute) On Unix, Chmod the user.log to 666 or rw-rw-rw 4. Make a directory called "htmfiles" (no quotes) Place all files you want to protect in this directory. SECURIETY NOTE: It is best to make this directory under your cgi-bin (cgi-bin/htmfiles) Usually a directory under your cgi-bin can not be accessed with a Web Browser. 5. Put a link to the login.html on your page (the login.html is a frameset that calles -> login-form.html) Chmod is not necessay on Windows NT. Ranson's Scripts FAQ and install help
To add a user to your system, call the adduser.pl with your browser. That
is, type the URL of the adduser.pl in the "location" line of whatever
browser you are using.
Enter a user name and password for that user. This writes their user name and password to the 'user.log'.
Place all the files you want to protect in the "htmfiles" folder.
In the login.pl, you will tell the program what file you want the user to access when they login. (the default file)
To protect the web address of other files, you will need to link them "through" the login.pl.
The link to page2.html would look something like this:
<http://www.your_server.com/cgi-bin/login.pl?999&page2> (the 999 must be in the URL exactly as shown)
Do Not use the .html on the link to the protected files. The program will do that
(The files must be named something.html)
No one ever sees the URL to the pages, they will only see the URL of the login.pl.
I have supplied 3 pages for you to test with. They are in the folder "htmfiles".
Use these files to get the program running on your server. Then replace them with
In the login.pl there are 3 variables you will need to change.
# Enter the complete path and name of the user.log (password file) $user_list = 'c:\website\wsdocs\new-password\user.log'; # Enter the path and name to the directory (folder) where the files are # you want to password protect $protected_files = 'c:\website\wsdocs\new-password\htmfiles'; # Enter the name of the default file to open when the user logs in $default_file = 'page1.html'; (use the full name here - page.html)
In the adduser.pl there is one variable you will need to change, the name of your password file.
# Enter the complete path and name of the user.log
$user_list = '/usr/home/rlaj/cgi-bin/password/user.log';