Mercurial > hg > rlgallery-misc
annotate lighttpd/rlgallery.conf @ 74:900da50ee11c
Merge lighttpd configuration into one include file.
The lighttpd configuration was previously spread across several files
which were intended to overwrite the defaults. They often became
outdated.
Now all customization is in lighttpd/rlgallery.conf, which should be
included at the end of whatever main lighttpd configuration file is in
use. It should require minimal updates for new lighttpd versions or
distribution changes.
author | John "Elwin" Edwards |
---|---|
date | Wed, 28 Dec 2016 13:12:04 -0500 |
parents | |
children | 716f8305d412 |
rev | line source |
---|---|
74
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
1 # lighttpd configuration file for rlgallery.org |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
2 # Include this file in your lighttpd.conf |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
3 |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
4 # Ensure index.cgi is in the list |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
5 index-file.names += ( |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
6 "index.xhtml", "index.html", "index.htm", "index.cgi" |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
7 ) |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
8 |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
9 server.modules += ( "mod_cgi", "mod_redirect", "mod_setenv" ) |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
10 |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
11 cgi.assign = ( ".cgi" => "" ) |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
12 |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
13 # The old static high score page now redirects to the CGI script |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
14 $HTTP["host"] =~ "^(.*)$" { |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
15 url.redirect = ( |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
16 "^/scoring/highscores.html" => "http://%1/scoring/high.cgi?l=40" |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
17 ) |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
18 } |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
19 |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
20 # Don't send CGI scripts or python scripts as static files |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
21 static-file.exclude-extensions += ( ".cgi", ".py" ) |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
22 |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
23 # Use the custom 404 error page |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
24 server.error-handler-404 = "404.html" |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
25 |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
26 # Set a UTF-8 environment, or Python 3 won't work |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
27 setenv.add-environment = ( |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
28 "LC_CTYPE" => "en_US.utf8" |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
29 ) |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
30 |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
31 # Turn on directory listing where it is needed |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
32 $HTTP["url"] =~ "^/files/" { |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
33 dir-listing.activate = "enable" |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
34 } |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
35 $HTTP["url"] =~ "^/ttyrecs/" { |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
36 dir-listing.activate = "enable" |
900da50ee11c
Merge lighttpd configuration into one include file.
John "Elwin" Edwards
parents:
diff
changeset
|
37 } |