Use the following basic instructions to password-protect a traditional class web page. Be sure to replace "abc123" with your actual class designation, and "Winter16" with the quarter you're teaching, and "password" with a secure password that you will give students to access the folder.
-
Create the folder you want to secure:
mkdir /cse/classes/abc123/Winter16/PRIVATE
-
Change into that folder:
cd /cse/classes/abc123/Winter16/PRIVATE
-
Create a .htpasswd file:
htpasswd -b -c .htpasswd abc123 password
-
Create a .htaccess file with the following contents:
AuthType Basic
AuthName "ABC123 Class Web Page" AuthBasicProvider file AuthUserFile /cse/classes/abc123/Winter16/PRIVATE/.htpasswd require valid-user -
Make sure the permissions are set correctly:
chmod 755 /cse/classes/abc123/Winter16/PRIVATE chmod 644 /cse/classes/abc123/Winter16/PRIVATE/.htpasswd chmod 644 /cse/classes/abc123/Winter16/PRIVATE/.htaccess
Then you can test your secure folder at a URL similar to the following:
https://classes.soe.ucsc.edu/abc123/Winter16/PRIVATE/