scripts.mit.edu

MIT SIPB Script Services for Athena

FAQ → General Questions

How do I make a file accessible to Apache?

You can run

chmod 777 FILENAME
to make a single file named FILENAME accessible to the Apache web server.

Marking files in this way is usually necessary when creating an .htaccess file or using software that does so (such as Wordpress). If you create an .htaccess file and do not mark it readable by Apache, all requests to URLs under that directory will fail with and return 401 Forbidden. Accordingly, you can run

chmod 777 .htaccess

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, 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. However, the Apache server needs to read the .htaccess file to determine how to process requests.

Previous:
Next:
© 2004-2008, the SIPB scripts.mit.edu project.
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 better-mousetrap.mit.edu.