User Tools

Site Tools


techstaff:personal_homepage

This is an old revision of the document!


Personal Homepage

This document describes how to setup a web site inside of your home directory which can be accessed at this URL: http://people.cs.uchicago.edu/~username

Step by step

1. Permissions on your home directory

Set your home directory to allow for at least execute permissions on group and other. This will enable the web server to execute the html files inside your home directory.

user@host:~$ ls -ld $HOME
drwx------ 60 user group 4096 Dec 17 15:56 /home/user
user@host:~$ chmod 711 $HOME
user@host:~$ ls -ld $HOME
drwx--x--x 60 user group 4096 Dec 17 15:56 /home/user

2. Creating the directory that will host your site

Our web server looks for a folder with the name of 'html' inside your home directory from which it will attempt to serve. If you do not already have this directory create it.

user@host:~$ mkdir -p $HOME/html

We want to make sure the web server has enough permissions to this directory.

user@host:~$ chmod 755 $HOME/html

Verify the change.

user@host:~$ ls -ld $HOME/html
drwxr-xr-x 2 user group 53 Dec 17 15:57 /home/user/html

3. Creating your first web page

We can create a simple page by doing the following:

user@host:~$ echo 'hello world' > $HOME/html/index.html
user@host:~$ chmod 644 $HOME/html/index.html
user@host:~$ ls -l $HOME/html/index.html
-rw-r--r-- 1 user group 28 Dec 17 15:57 /home/user/html/index.html

4. Viewing your home page

You can access your home page by using the following URL: https://people.cs.uchicago.edu/~username Please replace 'username' with your CNETID.

Password protecting a directory

Password protecting your web pages Note: People viewing your page with a web browser will be required to provide a password. However, since files in your ~/html directory must be world readable to be seen by the server, anyone with a CS account can view your html files directly.

Create new password file (with a user):

htpasswd -c .http_passwd new_user
  1. (note: the password file should not be in your html directory, but it must be world readable)
  2. To add more users (no -c!)
htpasswd .http_passwd user2

Put a file .htaccess in each html directory to be restricted. Start with this template:

AuthUserFile /home/mokwa/html/.http_passwd
AuthName Projec
AuthType Basic
require valid-user
chmod 644 .htaccess
/var/lib/dokuwiki/data/attic/techstaff/personal_homepage.1459262443.txt.gz · Last modified: 2016/03/29 09:40 by kauffman

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki