Web Site Permissions

For more detail about the meanings of the permissions listed here, read Unix Permissions first.

Your bama account has to give the Web server permission to read your Web directory. What a surfer sees depends on how you set the permissions.

Your home directory should have its permission set to rwx--x--x by default. You can check by doing
ls -l .
while in your home directory. Note that "." refers to your current directory; it is not just a period.

This permission is represented by the number 711. If the listing shows a permission other than rwx--x--x for your home directory, set it using the command
chmod 711 .

By default, your public_html directory should be rwxr-xr-x (755). With this setting, if a Web surfer connects to "http://bama.ua.edu/~youraccount", the server will display either your home page (if a file with the name index.html, index.htm, or index.shtml exists) or a listing of all the files in that directory.

Your other option for your public_html directory is rwx--x--x (711). This permission setting will not show a file listing. If there is no home page, the Web surfer will receive a "Forbidden" error message.

To check your public_html permissions, do
ls -l public_html
while in your home directory. To change the permissions, then execute
chmod 755 public_html or chmod 711 public_html

Individual files within your Web site should have a permission of rwxr--r-- (744), while subdirectories can have either of the permissions given above for public_html.

To check the permissions, do
cd public_html
to get into the public_html directory, then
ls -l
to see all the files with their permissions.

To set the permissions, do
chmod 744 filename or chmod 755 subdir or chmod 711 subdir
where filename is the name of a Web page file and subdir is the name of a subdirectory under public_html.