Creating Your Homepage
- Create a directory in your home directory named public_html:
mkdir public_html - Change the permissions on the directory public_html so others have execute permissions (ability to change into that directory):
chmod o+rx public_html - Using a text editor or an HTML editor, create a file named index.html that contains the HTML code for your home page. (A fairly basic tutorial on HTML can be found here (link to http://www.w3.org/MarkUp/Guide/)) Save this file in your public_html directory.
- Change the permissions on that file so others can read it:
chmod o+r index.html
Your web page can now be accessed by going to the following url in your browser:
http://math.mit.edu/~username (replacing username with your login name)
If you would like your homepage listed in the Math Department People Directory, email webmaster@math.mit.edu.
CGI Programs
If you wish to add additional functionality to your site you may want to install some CGI programs. In order to add a CGI program, take the following steps:
- In your public_html directory, create a directory named cgi-bin
- Change the permissions of that directory so it is executable by others.
- Put any CGI programs you'd like to run from your web site in the cgi-bin directory, ensuring they are executable by others and have the suffix .cgi
If you are having trouble getting a CGI program to execute, ensure that permissions on the files and parent directories are not too permissive and are owned by you. There is a security mechanism in place that prevents the program from being run if these conditions are not met.
Please note that while we provide the means for you to use CGI programs, we cannot provide any support in installing or configuring them.
How to set up a protected web page:
- Create your protected directory. (i.e. ~ripe/public_html/private/, or ~ripe/www/private/)
- Make a file called ".htaccess" inside of your private directory. It must include these lines:
- 'AuthName' is the title of the authentication box. This can be changed to give a short discription of the protected page.
- 'AuthType' is how users autenticate. This does not need to be changed.
- 'AuthUserFile' tells .htaccess where to find password file. ~user/ path name's will not work.
- 'require vaild-user' only lets user names listed in AuthUserFile to have access.
- Create your password file in the directory where .htaccess is looking to find it (AuthUserFile). As a rule of thumb, this file should not reside in the same directory as your protected page.
- Test access to your protected page.
AuthName "Protected Page"
AuthType Basic
AuthUserFile /home/r3/ripe/passwords (change this to reflect your own homedir)
require valid-user
# pwd
/home/r3/ripe
>htpasswd -c passwords login_username_here
NOTE: When adding new users to the AuthUserFile, the -c flag for htpasswd is not needed, as it is only used to create a new AuthUserFile.

