CSC 105

Setting permissions on your files

 

All the files you upload to the course account must be readable by the web server. Sometimes this does not happen automatically, and you need to manually grant permission to the server to read the files. (The symptoms of this problem can be less than obvious. For example, if you have uploaded images, or a style file, that does not seem to be working properly, and you are sure the link to it is correct, it may be a permission problem.) Here's how you can check.

Open the SSH file transfer window, right-click on a file and choose Properties. Make sure it is executable and readable by everyone, and writeable by the owner (permission mask = 755). Ordinary files (as opposed to folders) should not be executable (permission mask = 644). If the permissions are set wrong on a file, or on one of the folders it is within, then you may not be able to view the file in a web browser.

Capitalization in File Names

Another problem that can masquerade as a permission error is a mismatch in the capitalization of a file name. Usually this happens either in the link to a style sheet file, or in the link to an image file. For example, if a file is called myPhoto.JPG and you link to it as shown below, it will appear that the image is unreadable when in fact it just cannot be found under the exact filename you gave.

<img src="myPhoto.jpg" />

To make all this even more confusing, Windows disregards capitalization in file names. So your site may work when you test it on Windows, but stop working when you upload it to Beowulf (which runs Unix). The moral: if it works on your local machine but not once you've uploaded everything, and you've checked the file permissions as described above, it's probably a file name capitalization problem.