1 # -> /etc/apache2/conf.d |
1 # This file should be placed as |
|
2 # -> /etc/apache2/conf-available/once.conf |
|
3 # and then you may use `a2enconf once` |
2 |
4 |
|
5 <Macro ONCE $location $var $lib> |
|
6 SetEnv ONCE_VAR $var |
|
7 SetEnv ONCE_LIB $lib |
3 |
8 |
4 # The directory where the files are stored, |
9 # The directory where the files are stored. |
5 # it needs to be writable by the web server user (wwwrun, www-data, |
10 # This directory needs to be r/w by the web server user |
6 # who ever) |
11 # (wwwrun, www-data, who ever), but it must not be |
7 # SentEnv may go into the <Directory>...</Directory> |
12 # accessible via HTTP(s) |
8 SetEnv ONCE_VAR /var/lib/once/ |
13 <Directory $var> |
|
14 Require all denied |
|
15 </Directory> |
9 |
16 |
|
17 Action once-handler /once-handler/once.cgi virtual |
|
18 ScriptAlias /once-handler/ $lib/ |
|
19 Alias $location/public $lib/public |
10 |
20 |
11 # Action may go into <Location>...</Location> |
21 # Order of location blocks matters! |
12 Action once-handler /once-handler/once.cgi virtual |
22 # We handle requests to our script, with the exception (see below) |
|
23 # for …/public/… requests. These should be answered from a simple |
|
24 # static directory for style sheets and similiar |
|
25 <Location "$location"> |
|
26 SetHandler once-handler |
|
27 </Location> |
|
28 <Location "$location/public"> |
|
29 SetHandler none |
|
30 </Location> |
13 |
31 |
14 # Order of location blocks matters! |
32 <Directory "$lib/public"> |
15 <Location "/once"> |
|
16 SetHandler once-handler |
|
17 </Location> |
|
18 <Location "/once/public"> |
|
19 SetHandler none |
|
20 </Location> |
|
21 |
|
22 #<Location "/once/d"> |
|
23 # SetHandler once-download-handler |
|
24 # Action once-download-handler /once-handler/download.pl virtual |
|
25 #</Location> |
|
26 |
|
27 Alias /once/public /usr/local/lib/once/public |
|
28 <Directory "/usr/local/lib/once/public"> |
|
29 Require all granted |
33 Require all granted |
30 Allow from all |
34 Allow from all |
31 </Directory> |
35 </Directory> |
32 |
36 |
33 |
37 <Directory "$lib"> |
34 ScriptAlias /once-handler/ /usr/local/lib/once/ |
|
35 <Directory "/usr/local/lib/once"> |
|
36 Require all granted |
38 Require all granted |
37 Allow from all |
39 Allow from all |
38 Options ExecCGI FollowSymlinks |
40 Options ExecCGI FollowSymlinks |
39 </Directory> |
41 </Directory> |
|
42 </Macro> |
|
43 |
|
44 Use ONCE /once /var/lib/once /usr/local/lib/once |
|
45 UndefMacro ONCE |