Password protecting a page

As you proceed, you may want to set up web pages that are only accessible by members of your team. You might do this to review information among team members prior to releasing it to the public. Or you may share information for collaboration purposes (instead of dissemination purposes) and simply enforce restricted access. Of course, you may maintain directories with group permissions only to enforce restricted access, and these would also not be viewable on the web. To create a web page that is viewable only by team members, you should create a folder (directory) inside the team folder. Any file inside that folder will be password protected. Your main directory should not be password protected so that your main page is visible by anyone.
Copy the old.htaccess file from /web/classes/ee482/design0 to the new folder and rename it .htaccess.

	    mv /web/classes/ee482/design0/old.htaccess .htaccess
Edit this file and change the path on the first line to the location of this new folder, followed by .htpasswd.
Next, edit the second to last line, require user design0, from design0 to your_team_name. Now you must create the password file. At the UNIX prompt, in the new directory, type:
	      htpasswd -c .htpasswd your_team_name
	    
Now it will prompt you to enter a password for the user your_team_name. Choose whatever you want.
Make sure that the permissions on both .htaccess and .htpasswd are 664. Readable and writable by the owner and group. Readable by anyone else. Now, any attempt to access a page in that directory from the web page will result in a prompt asking for user authorization. For the username use your_team_name and for password, use the password you made up for the .htpasswd file. If you have any problems, first make sure the permissions are correct, and that the absolute path to the password file in .htaccess is correct. If you have any questions, email Sergio Marti

Last Updated May 27, 1997