How to create your home page
- SSH into one of the moons or trucks machines.
- Create a directory called “public_html” under your home directory:mkdir public_html
- Change to the new directory:cd public_html
- Create a file called “index.html” with a text editor. This will be the top-level home page file.
- Be sure that your public_html directory, index.html file, and any other files you want on-line are world-readable and executable. From your home directory, issue this command:chmod -R o+rx public_html.This is so the web server can read your files.
People can reference your home page using the URL “http://www.cs.unm.edu/~username/“, where “username” is your user login.
I changed public_html like directed, but the web server still doesn’t show my page. What gives?
Make sure your home directory is executable by other (which is the default for new accounts). First, change to your home directory, and then issue this command:
chmod o+x .
(Don’t forget the dot!) Otherwise, the web server will not be able read your home directory to see whether your public_html directory is readable or not. This does mean that other users on the system can see your filenames and top level directory names (and permissions), but does not imply that they can read your files. Nor does it imply that the contents of your subdirectories can be listed either.
How do I use a cgi-bin directory on my web page?
- Email systems at firstname.lastname@example.org requesting to have a cgi-bin directory created for you.
- Type cd /nfs/notrust/cgi-bin/username, and put your files there (where username is your username). Make sure to make your cgi files executable: while in your cgi-bin directory, type this command: chmod -R o+rx * .
- Make sure your paths have a full absolute URL going to http://cgibin.cs.unm.edu/username-bin/.
Things to watch out for
Home page name. If you have two files, one called index.html and one called index.htm, the web server will only ever show one of those. If you edit the wrong file, it could be very frustrating.
Speaking of names, pick either an “.html” or an “.htm” extension and stick with it. This will help prevent broken links due to linking to “myvacationpics.html” when it’s “myvacationpics.htm”. Don’t think Windows can’t handle .html as an ending.
To connect remotely, use moons.cs.unm.edu or trucks.cs.unm.edu and SFTP (but see the following note).
Note: Although you can use Dreamweaver to edit your pages, you will need to use an FTP client that fully supports SFTP with SSH2 authentication, or SCP, to upload them. Although Dreamweaver MX 2004 and Dreamweaver 8 claim to support SFTP, they can not handle encrypting the username and password, and therefore will not work with the CS department’s webserver. FTP programs known to work correctly with the CS department webserver include Filezilla (Windows Only, freeware), CoreFTP LE (Windows only, freeware), Transmit (Mac OS X only, shareware). The other option is to use scp. The “scp” command is built into Mac OS X and Linux: for Windows, download the putty package (the command you want is pscp.exe) or WinSCP.
Some FTP clients will occasionally upload a zero-byte file. This is one reason you should always check your page after uploading it. Once in a blue moon, some will manage to delete your local copy too. If this happens, don’t panic, login and restore the file you were editing. Chances are, you’ll have a backup only an hour old waiting for you.
Be careful: if you ever decide to make your home directory not world readable, a recursive command will change your public_html directory too. Go back and re-issue the same command you did when you first created web directory to keep it accessible. Also, don’t forget your home directory *must* be world executable or the web server won’t even look at the permissions on your public_html directory. (chmod o+x . will fix this problem if issued from your home directory)