Department Web Hosting

Securing Web Files with htpasswd

With your website you can actually control access to the files with in your directories.

To install htpasswd support on your local system you will need the apache2-utils package installed (in ubuntu).

Using htpasswd

First create the directory you want to control access to. Then create a .htaccess file within the created directory.

Populate the information as you need. A sample is below:

AuthName "Restricted Area"
AuthType Basic
AuthUserFile /web/<designation>/<username>/<directory>/.htpasswd
AuthGroupFile /dev/null
require valid-user

Notice it is looking for .htpasswd

To create the .htpasswd file from the command line in linux use the below command:

htpasswd -b -c /web/<designation>/<username>/<directory> /.htpasswd <username to use> <password to encrypt>

The designation is either faculty or students, depending on your role.

Public HTML

As a student in this department, you have access to website hosting from your accounts profile. Follow instructions below to understand how to use this resource.

Linux Command Line

Log into any lab machine in Linux and open a terminal, or access a lab computer using SSH..

First, we must set the correct permissions on your home directory:

chmod o+x /web/students/$(whoami)

If you do not already have one, create an index.html file:

touch /web/students/$(whoami)/index.html

Finally, set the correct permissions on your index.html file and its prospective subfolders and files:

chmod -R o+rx /web/students/$(whoami)/

Accessing Student Web

To access the files in your web directory, open a web browser and navigate to https://studentweb.cs.wwu.edu/~/ and click on your username or go to https://sw.cs.wwu.edu/~username.