Question: Some of my web pages can't be viewed. How do I fix this?
Author: Joseph Tam
Date: Sept. 14, 2007
The most common reason that access to your web data fails is the
permissions set on the data is too restrictive, thus preventing the
web server from reading it. Another common reason is the name of the
file/directory being accessed is not spelled exactly the same way,
or the URL maps to a blind directory (see below for explanation).
Permissions on web files and directories placed in your personal web
directory should be readable by everybody, but writable only by you.
You can use this Unix utility to automatically go through your entire
web directory to set the correct permissions:
# Reset my web files with sensible permissions ...
FixWebPerm
# To get help with all available options ...
FixWebPerm -h
One exception to the above is the web folder itself; the permission
on this folder ought to be kept as is -- it has been specially set up
so that only you and the web server has access. This keeps out other
people with access to the file system from perusing the contents of your
entire web folder, including password protected pages and unlinked pages
and files. The permissions acts like a gatekeeper.
To manually set the permissions on individual files and directories,
using the Unix command line
# For files ...
chmod 0644 file1 file2 ...
# For blind directories ...
chmod 0711 dir1 dir2 ...
# For listable directories ...
chmod 0755 dir1 dir2 ...
The difference between a blind and listable directory
is that the list of files (i.e. table of contents) for blind directories
are denied to the browser, whereas listable directories allows this
list to be fetched. You can still access the contents of files within
a blind directory, but the filename must be explicitly named in the URL
or linked to some web page.
If the URL maps to a directory, it will try and fetch the page
index.html within by default. If that fails, it will try
and list the files contained within that that directory, unless it
is blind.
Users who mount their web folder on a Windows workstation
using our Samba service should use the correct UNC pathname (see this FAQ item). Using the correct UNC
will ensure permissions to those files will be set up correctly.
You should not place private files, confidential information, exam
or homework solutions within your web folder without some safeguards
like encryption. Your web folder is meant for public data; use your
home directory to store private data instead.
|