How do I make a file accessible to Apache?
To mark a single file accessible to Apache
You can run
chmod 777 FILENAMEto make a single file named FILENAME accessible to the Apache web server.
To mark an entire directory world-readable
If you want to make an entire directory world-readable, you can change its AFS access control list in order to do so. You can do so by “cd”-ing to the directory and then running
fs sa . system:anyuser read(You should run these commands on an Athena workstation or dialup, instead of directly on the scripts servers.) Then, you will also need to create a .htaccess file containing the following:
<Files *>
SetHandler none
</Files>
This instructs Apache to pass the files through directly, rather than attempting to interpret them as code.
Technical Information
The file system on Athena (AFS) usually ignores chmod modes, but scripts.mit.edu normally restricts AFS access to a home directory to the owner of that home directory. However, the special mode 777 has special meaning on scripts.mit.edu (we run a modified AFS client), and indicates that the Apache web server may directly access the file. No other chmod modes will have the same effect.
This is usually not needed for actual scripts or even most static content (such as .html files), since those files are accessed via your user account. It was previously needed for .htaccess files, but now (as of June 2009) Apache is given implicit read permission on all files whose names begin with “.ht”, such as .htaccess and .htpasswd.

| Previous: | Can I use scripts.mit.edu to generate an Apache-style log file for my web.mit.edu site? |
| Next: | Why does reading files cause 'permission denied' errors on scripts.mit.edu? |
These pages may be reused under either the GFDL 1.2 or CC-BY-SA 3.0.
Questions? Contact scripts@mit.edu.
You are currently connected to cats-whiskers.mit.edu.
Other projects by the scripts.mit.edu creators:
MIT's Linux SSH server: Linerva | Athena on Ubuntu: Debathena | Linux security: Ksplice
