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