How do I fix the permissions on my html directory and files?
Using the Account Management Site
To fix the permissions on your html
directory on Eniac:
- Visit Personal Homepage.
- Check the Configure My Account for Webpages box.
- Click the Submit button.
This will:
- Create the
html
directory, if it is missing. - Create the
public_html
symlink, if it is missing. - Set the appropriate permissions on the
html
directory. - Set the appropriate permissions on the SEAS account home directory.
- Create an example
html/index.html
page, unless one already exists. - Create an example
cgi-bin/index.php
directory and page, unless one already exists (only accessible in restricted environments after CGI has been enabled for the account).
Note: This tool is limited and will not attempt to fix the permissions on all files in an existing site. If there are still errors, it may be necessary to address them individually. See the steps below for examples.
Using WS_FTP
If you are using WS_FTP and the permissions of the files
are not -rw-r--r--
(644) or -rw-rw-r--
(664):
- Right-click on a file.
- Select File Attributes.
- Click on Read in the category Public Permissions and in the category Group Permissions.
This will allow the file to be readable by any user on the system, including
the web server user, which is needed in order to view your web page. In a
similar way you can change your directory permissions to
-rwxr-xr-x,
(755).
Using UNIX
Log into the SEAS account on eniac.seas.upenn.edu and run these commands to fix the basic permissions for your website:
chmod a+x ~
chmod a+rx html
chmod a+r html/index.html
You may also need to fix the permissions on other files and directories
recursively, following this example for the ~/html/images
directory and its files:
find ~/html/images -type d -exec chmod a+rx {} +
find ~/html/images -type f -exec chmod a+r {} +
Warning: These commands will make all affected files readable on the Internet and to other accounts on the system. Take care not to inadvertently expose sensitive information.
It usually not necessary to make the cgi-bin
,
wiki
or wordpress
directories publicly readable, as
CGI/PHP applications are configured to run as the account that owns the files
on SEAS web servers.