.
Uranium Sulfur Oxygen Department of Chemistry The Ohio State University Department of Chemistry Department of Chemistry The Ohio State University I go round and round Department of Chemistry The Ohio State University return to the chemistry home page return to the chemistry home page return to the main graduate page return to the chemistry home page return to the main internal resources page return to the chemistry home page return to internal resources page return to the computer support page return to the chemistry home page return to the main undergraduate page

     

blank How do I setup password-protected web pages?

How to setup password protected web pages There are few files you need to create in order to setup password protection, a .htaccess file in the directory you want to protect and password and group (optional) files. The first line of the .htaccess states where the password file is located. Here is a simple .htaccess file:


AuthUserFile /home/staff/user/pwd/.htpasswd
AuthName "myfriends"
AuthType Basic
 

require user jack
require user jill
require user fred



This files will allow only the users jack, jill and fred to access the page. If you have many users you may want to set up a group file as well. Here's an example of a .htaccess using a group file:


AuthUserFile /home/staff/user/pwd/.htpasswd
AuthGroupFile /home/staff/user/.htgroup
AuthName "myfriends"
AuthType Basic
 
require group friends



Now to setup the password and the group file. Both files must be world readable. You also do not want to put these files in the WWW (or WWWS) directory where they can be downloaded. In the examples I set up a directory name "pwd" to store these files. Use the command htpasswd to create and add to the password file. Here's how to create the directory and setup a password file:


chemistry% pwd
/home/staff/user
chemistry% mkdir pwd
chemistry% chmod a+x pwd
chemistry% cd pwd
chemistry% htpasswd -c .htpasswd jack
Adding password for jack.
New password:
Re-type new password:
chemistry% htpasswd .htpasswd jill
Adding password for jill.
New password:
Re-type new password:
chemistry% chmod a+r .htpasswd


You only use the -c option when you create the password file. The group file is a simple format like this:


friends: jack,jill,fred
enemies: peter,paul,mary
Contact Information:
Department of Chemistry
The Ohio State University
100 W. 18th Avenue
Columbus, Ohio 43210
phone: (614) 292-2251
fax: (614) 292-1685
Contact Us

If you have trouble accessing this page and need to request an alternate format,
please contact Michael Reed at mreed@chemistry.ohio-state.edu

© 2005, All rights reserved, The Ohio State University, Department of Chemistry