All SCS students, faculty and staff have the possibility of setting up a personal website hosted at SCS. The requirements are:
- must be a current SCS student, faculty or staff
- must have an SCS Linux account
You must have an SCS Linux account in order to host your personal SCS website; a Windows account is not enough.
- First Time Set-up
To create a homepage, you must:
- Log into your Linux account
- Create a directory called “public_html” under your home directory
- Move your homepage files into this directory
- Change the permissions on these files (“chmod 644” for the files)
- Change the permissions on the directory (“chmod 711 ~/public_html”)
- Change the permissions on the home directory (“chmod 711 ~user_name”)
The URL for the homepage you have created is:
The file called index.html (all lower case) is the default webpage for your directory. In other words if someone tries to access
http://www.scs.carleton.ca/~user_namethen the file index.html under user_name’s Linux public_html folder will be displayed.
- Transfering files to your website
You can transfer files to your website from anywhere on the internet using a windows utility called winscp that can be downloaded for free. You can use any file-transfer utility that you like as long as it supports the scp or ssh protocol.
From the internet you will need to connect to access.scs.carleton.ca in order to transfer your files. access is the school’s external access host.
File permissions on your website should be set to 644 and directory permissions set to 711 (755 for readable web-directories).
For more info about how to change perms in Linux refer to the chmod reference documentation. If you prefer windows GUI’s its possible to change file and directory permissions using winscp.
Changing directory and file permissions using winscp
It is possible to log into your SCS Linux account using winscp and then change the directory and file permissions. Once your logged in using winscp right click on a file or directory and choose properties. For directories you can set the octal Permissions to 0711.
File permissions for typical web-accessible files are set to 0644.
You can easily change directory and file permissions using winscp as well as transfer your files and create directories under your SCS Linux account. In this way you can quickly get your SCS website up-and-running.
- Password protecting your webpage with .htaccess
If you wish to password protect a specific directory under your SCS webpage you will need to create a .htaccess file in that directory (somewhere under ~/public_html). The .htaccess file needs to have -rw-r–r– permissions (chmod 644 .htaccess). You will also need a .htpasswd file. You are required to change permission on your ~/public_html to -rwxr-xr-x (chmod 755 ~/public_html).
You can copy and paste this default .htaccess file:
AuthUserFile .htpasswd AuthGroupFile /dev/null AuthName "SCS Web Protect" AuthType Basic # SCS is the username Require user SCS # A second user needs a second Require line
You must give the full path to the above .htpasswd file.
You can try it using login: SCS and password: secure . The .htpasswd file looks like (username:encryptedPassword):
You should create your own htpasswd file in your own homedirectory. You will need to encrypt your own passwords (online encryption utility). One way to encrypt passwords is to the following short perl script (copy and paste it to a file, say salt.pl):
#! /usr/local/bin/perl print "Enter salt: "; chop($salt=<STDIN>); print "Enter pass: "; chop($pass=<STDIN>); print crypt( $pass,$salt )."\n";
Make the salt.pl file executable (chmod 700 salt.pl) and execute it. Enter a 2-letter character when it prompts for the salt. Enter the password when it prompts for the password and it will return a 13 digit encrypted version of your password. The password encryption should look something like this:
[jsmith@epsilon06 ~/usefulscripts]$ salt.pl Enter salt: Yw Enter pass: secret e5tCRRIXrK0Ys
You can now copy and paste the encrypted password into your .htpassword file
File Directory Listing with .htaccess
If a URL which maps to a directory is requested, and there is no index file (e.g., index.html, index.shtml) in that directory, then the server will return “Access Denied”. Directory listing is now set at the directory level and not at server level.
In order to add directory listing create an .htaccess file in the desired directory, or if it exists then append the following line:
The .htaccess file needs to have -rw-r–r– permissions (chmod 644 .htaccess). Make sure permissions on your ~/public_html are -rwxr-xr-x (chmod 755 ~/public_html).