]> scripts.mit.edu Git - www/raw.git/blob - faq/48.mdwn
Import from TextPattern
[www/raw.git] / faq / 48.mdwn
1 [[!meta title="How do I make a file accessible to Apache? (I'm getting a 401 Forbidden error)"]]
2 ## To mark a single file accessible to Apache
3
4 You can run
5     chmod 777 FILENAME
6
7 to make a single file named FILENAME accessible to the Apache web
8 server.
9 ## To mark an entire directory world-readable
10
11 If you want to make an entire directory world-readable, you can
12 change its AFS access control list in order to do so. You can do so
13 by “cd”-ing to the directory and then running
14     fs sa . system:anyuser read
15
16 (You should run these commands on an Athena workstation or dialup,
17 instead of directly on the scripts servers.)
18 It may take some time for Scripts to pick up the permission
19 changes; you can speed up the process by running
20     athrun scripts for-each-server fs flushv
21
22 If you would like to make programs that are normally executable
23 downloadable by the user, you will also need to create a .htaccess
24 file containing the following:
25
26 <Files \*\>  
27 SetHandler none  
28 </Files\>
29
30 This instructs Apache to pass the files through directly, rather
31 than attempting to interpret them as code.
32
33 ## Technical Information
34
35 The file system on Athena (AFS) usually ignores chmod modes, but
36 scripts.mit.edu normally restricts AFS access to a home directory
37 to the owner of that home directory. However, the special mode 777
38 has special meaning on scripts.mit.edu (we run a modified AFS
39 client), and indicates that the Apache web server may directly
40 access the file. No other chmod modes will have the same effect.
41
42 This is usually not needed for actual scripts or even most static
43 content (such as .html files), since those files are accessed via
44 your user account. It was previously needed for .htaccess files,
45 but now (as of June 2009) Apache is given implicit read permission
46 on all files whose names begin with “.ht”, such as .htaccess and
47 .htpasswd.
48
49
50