←  All notes
Web hosting on cs.purdue.edu

First see this help page: Creating personal homepage.

Undergraduate students don’t have a “directory page,” but you do have a “personal page.”

WWW server

While your home directory is on an NFS drive and is mounted on all of the CS servers, only one of them hosts the web server. At the time of writing, this is pythia.cs.purdue.edu:

$ dig +short www.cs.purdue.edu
pythia.cs.purdue.edu.
128.10.19.120

More advanced features

The web server running on pythia.cs is Apache HTTPd. It’s using mod_userdir to serve per-user directories. See the Allowing users to alter configuration section of that page; it mentions that we can use .htaccess files to modify web server configuration for our directory. (The help pages also mention this.)

For example, you can disable directory listings so clients can access files in a directory but not list the contents (like removing the read permission from a UNIX directory):

# Don't provide directory listings
Options -Indexes

See the tutorial on .htaccess files for more information on what you can do with these files.

Reverse proxy

You can use your personal page as a reverse proxy using a configuration like this:

# Enable rewrite rules
RewriteEngine On
# Set the base path that rewrites will match relative to
RewriteBase "/homes/kkasad/"
# Redirect the path to always include a trailing slash
RewriteRule "^forward$" "/homes/kkasad/forward/"
# Reverse proxy to the given site
RewriteRule "^forward/(.*)$" "http://data.cs.purdue.edu:20202/$1" [proxy]

This will send requests for https://cs.purdue.edu/homes/kkasad/forward/XXX to to http://data.cs.purdue.edu:20202/XXX, where XXX is any sub-path.