First you need to decide if you want to restrict access with:
a username and password that you create
by hostname or network address
a Computer Science Department account
Keep in mind that this restricts web-based access only. If someone has a CS account
they can view any directory on the server.
Creating an .htaccess file
Any of these protection methods requires an .htaccess file.
The .htaccess file goes in the directory you want to restrict access to. For example, /fs/www/path/to/webdir/.htaccess.
To protect your directory with a username and password that you create, place the following content in your .htaccess
Create an .htpasswd file with the usernames and hashed passwords that will be able to access the directory. The easiest way to do this is with the htpasswd utility. If the .htpasswd file doesn’t exist, use the -c flag to create it.