LP#1681095 Set aggressive default cache expires timelines
[working/Evergreen.git] / Open-ILS / examples / apache / eg.conf.in
1 # :vim set syntax apache
2
3 LogLevel info 
4 # - log locally
5 # CustomLog /var/log/apache2/access.log combined
6 # ErrorLog /var/log/apache2/error.log
7 # - log to syslog 
8 CustomLog "|/usr/bin/logger -p local7.info" common
9 ErrorLog syslog:local7
10
11
12 # ----------------------------------------------------------------------------------
13 # Set up Perl 
14 # ----------------------------------------------------------------------------------
15
16 # - needed by CGIs
17 PerlRequire /etc/apache2/eg_startup
18 PerlChildInitHandler OpenILS::WWW::Reporter::child_init
19 PerlChildInitHandler OpenILS::WWW::SuperCat::child_init
20 PerlChildInitHandler OpenILS::WWW::AddedContent::child_init
21 PerlChildInitHandler OpenILS::WWW::AutoSuggest::child_init
22 PerlChildInitHandler OpenILS::WWW::PhoneList::child_init
23
24 # ----------------------------------------------------------------------------------
25 # Set some defaults for our working directories
26 # ----------------------------------------------------------------------------------
27 <Directory @localstatedir@/web>
28     Order allow,deny
29     Allow from all
30 </Directory>
31
32
33 # ----------------------------------------------------------------------------------
34 # XUL directory
35 # ----------------------------------------------------------------------------------
36 <Directory @localstatedir@/web/xul>
37    Options Indexes FollowSymLinks
38    AllowOverride None
39    Order allow,deny
40    Allow from all
41 </Directory>
42
43
44 # ----------------------------------------------------------------------------------
45 # Remove the language portion from the URL
46 # ----------------------------------------------------------------------------------
47 AliasMatch ^/opac/.*/skin/(.*)/(.*)/(.*) @localstatedir@/web/opac/skin/$1/$2/$3
48 AliasMatch ^/opac/.*/extras/slimpac/(.*) @localstatedir@/web/opac/extras/slimpac/$1
49 AliasMatch ^/opac/.*/extras/selfcheck/(.*) @localstatedir@/web/opac/extras/selfcheck/$1
50
51
52
53 # ----------------------------------------------------------------------------------
54 # System config CGI scripts go here
55 # ----------------------------------------------------------------------------------
56 Alias /cgi-bin/offline/ "@localstatedir@/cgi-bin/offline/"
57 <Directory "@localstatedir@/cgi-bin/offline">
58         AddHandler cgi-script .cgi .pl
59         AllowOverride None
60         Options None
61         Order deny,allow
62         Deny from all
63         Allow from 10.0.0.0/8
64         Options FollowSymLinks ExecCGI Indexes
65 </Directory>
66
67
68 # ----------------------------------------------------------------------------------
69 # Updates folder
70 # ----------------------------------------------------------------------------------
71 Alias /updates/ "@localstatedir@/updates/pub/"
72 <Directory "@localstatedir@/updates/pub">
73         <Files check>
74                 ForceType cgi-script
75         </Files>
76         <Files update.rdf>
77                 ForceType cgi-script
78         </Files>
79         <Files manualupdate.html>
80                 ForceType cgi-script
81         </Files>
82         <Files download>
83                 ForceType cgi-script
84         </Files>
85         AllowOverride None
86         Options None
87         Allow from all
88         Options ExecCGI
89 </Directory>
90
91 # ----------------------------------------------------------------------------------
92 # OPTIONAL: Set how long the client will cache our content.
93 # We set a long expires time for CSS, JavaScript, and images (default) because
94 # you can change the cache-key in opac/parts/config.tt2 to force browsers to
95 # reload them immediately.
96 # ----------------------------------------------------------------------------------
97 ExpiresActive On
98 ExpiresDefault "access plus 1 year"
99 ExpiresByType text/html "access plus 18 hours"
100 ExpiresByType application/xhtml+xml "access plus 18 hours"
101 ExpiresByType application/x-javascript "access plus 1 year"
102 ExpiresByType application/javascript "access plus 1 year"
103 ExpiresByType text/css "access plus 1 year"
104
105 # ----------------------------------------------------------------------------------
106 # Set up our SSL virtual host
107 # ----------------------------------------------------------------------------------
108 #Listen 443
109 NameVirtualHost *:443
110 <VirtualHost *:443>
111         DocumentRoot "@localstatedir@/web"
112         ServerName localhost:443
113         ServerAlias 127.0.0.1:443
114         SSLEngine on
115     SSLProxyEngine on # required for ErrorDocument 404 on SSL connections
116         SSLHonorCipherOrder On
117         SSLCipherSuite ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM
118
119     # If you don't have an SSL cert, you can create self-signed 
120     # certificate and key with:
121     # openssl req -new -x509 -nodes -out server.crt -keyout server.key
122         SSLCertificateFile ssl/server.crt
123         SSLCertificateKeyFile ssl/server.key
124
125     # - absorb the shared virtual host settings
126     Include eg_vhost.conf
127
128     # help IE along with SSL pages
129     SetEnvIf User-Agent ".*MSIE [1-5].*" \
130         nokeepalive ssl-unclean-shutdown \
131         downgrade-1.0 force-response-1.0
132
133     SetEnvIf User-Agent ".*MSIE [6-9].*" \
134         ssl-unclean-shutdown
135
136 </VirtualHost>
137
138 # ----------------------------------------------------------------------------------
139 # Set up our main virtual host
140 # Port 80 comes after 443 to avoid "unknown protocol speaking not SSL to HTTPS port!?" 
141 # errors, per http://wiki.apache.org/httpd/InternalDummyConnection
142 # ----------------------------------------------------------------------------------
143
144 # Commented to avoid warnings from duplicate "NameVirtualHost: *80" directives
145 #NameVirtualHost *:80
146 <VirtualHost *:80>
147         ServerName localhost:80
148         ServerAlias 127.0.0.1:80
149         DocumentRoot @localstatedir@/web/
150         DirectoryIndex index.html index.xhtml
151     # - absorb the shared virtual host settings
152     Include eg_vhost.conf
153 </VirtualHost>
154