]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/examples/apache/eg_vhost.conf
b79783257163acacabad645ad27029137a13ab4d
[working/Evergreen.git] / Open-ILS / examples / apache / eg_vhost.conf
1 # ----------------------------------------------------------------------------------
2 # This is the global Evergreen virtual host config.  Anything you want published
3 # through all virtual hosts (port 80, port 443, etc.) should live in here.
4 # ----------------------------------------------------------------------------------
5
6 # ----------------------------------------------------------------------------------
7 # Point / to the opac - if you have a custom skin or locale, point at it here
8 # ----------------------------------------------------------------------------------
9 RedirectMatch 301 ^/$ /opac/en-US/skin/default/xml/index.xml
10
11 # ----------------------------------------------------------------------------------
12 # Point / to the IP address redirector
13 # ----------------------------------------------------------------------------------
14 #<LocationMatch ^/$>
15 #    SetHandler perl-script
16 #    PerlHandler OpenILS::WWW::Redirect
17 #    Options +ExecCGI
18 #    PerlSendHeader On
19 #    #PerlSetVar OILSRedirectSkin "default"
20 #    # OILSRedirectDepth defaults to the depth of the branch that the OPAC was directed to
21 #    #PerlSetVar OILSRedirectDepth "0"
22 #    #PerlSetVar OILSRedirectLocale "en-US"
23 #    # Use the template-toolkit opac
24 #    #PerlSetVar OILSRedirectTpac "true"
25 #    allow from all
26 #</LocationMatch>
27
28
29 # ----------------------------------------------------------------------------------
30 # Assign a default locale to the accessible OPAC
31 # ----------------------------------------------------------------------------------
32 RedirectMatch 301 ^/opac/extras/slimpac/start.html$    /opac/en-US/extras/slimpac/start.html
33 RedirectMatch 301 ^/opac/extras/slimpac/advanced.html$ /opac/en-US/extras/slimpac/advanced.html
34
35 # ----------------------------------------------------------------------------------
36 # Configure the gateway
37 # ----------------------------------------------------------------------------------
38 OSRFGatewayConfig /openils/conf/opensrf_core.xml
39 # Translator memcache server.  Default is localhost
40 # OSRFTranslatorCacheServer 127.0.0.1:11211
41
42
43 # ----------------------------------------------------------------------------------
44 # Added content plugin
45 # ----------------------------------------------------------------------------------
46 <Location /opac/extras/ac/>
47     SetHandler perl-script
48     PerlHandler OpenILS::WWW::AddedContent
49     Options +ExecCGI
50     PerlSendHeader On
51     allow from all
52 </Location>
53
54 # Autosuggest for searches
55 <Location /opac/extras/autosuggest>
56     SetHandler perl-script
57     PerlHandler OpenILS::WWW::AutoSuggest
58     PerlSendHeader On
59     Allow from All
60 </Location>
61
62 # Flattener service
63 <Location /opac/extras/flattener>
64     SetHandler perl-script
65     PerlHandler OpenILS::WWW::FlatFielder
66     PerlSendHeader On
67     Allow from All
68 </Location>
69
70 # ----------------------------------------------------------------------------------
71 # Replace broken cover images with a transparent GIF by default
72 # ----------------------------------------------------------------------------------
73 RewriteEngine ON
74 RewriteRule ^/opac/extras/ac/jacket/(small|medium|large)/$ \
75     /opac/images/blank.png [P,L]
76
77 # ----------------------------------------------------------------------------------
78 # Add the row ID (RID) and date so we can make unAPI happy
79 # ----------------------------------------------------------------------------------
80 RewriteCond %{QUERY_STRING} (^r|&r)=(\d+)
81 RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}]
82
83 # ----------------------------------------------------------------------------------
84 # Pull the locale from the URL
85 # ----------------------------------------------------------------------------------
86 RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
87 RewriteRule . - [E=locale:%1]
88
89 # ----------------------------------------------------------------------------------
90 # For sanity reasons, default indexes to Off
91 # ----------------------------------------------------------------------------------
92 Options -Indexes
93
94 # ----------------------------------------------------------------------------------
95 # Configure the OPAC
96 # ----------------------------------------------------------------------------------
97 <LocationMatch /opac/>
98     AddType application/xhtml+xml .xml
99    
100     # - configure mod_xmlent
101     XMLEntStripPI "yes"
102     XMLEntEscapeScript "no"
103     XMLEntStripComments "yes"
104     XMLEntContentType "text/html; charset=utf-8"
105     # forces quirks mode which we want for now
106     XMLEntStripDoctype "yes" 
107
108     # - set up the include handlers
109     Options +Includes
110     AddOutputFilter INCLUDES .xsl
111     AddOutputFilter INCLUDES;XMLENT .xml
112                     
113     SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
114     
115     # This gives you the option to configure a different host to serve OPAC images from
116     # Specify the hostname (without protocol) and path to the images.  Protocol will
117     # be determined at runtime
118     #SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=static.example.org/opac/
119
120     # In addition to loading images from a static host, you can also load CSS and/or
121     # Javascript from a static host or hosts. Protocol will be determined at runtime
122     # and/or by configuration options immediately following.
123     #SetEnvIf Request_URI ".*" OILS_OPAC_CSS_HOST=static.example.org/opac/
124     #SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=static.example.org/opac/
125
126     # If you are not able to serve static content via https and 
127     # wish to force http:// (and are comfortable with mixed-content
128     # warnings in client browsers), set this:
129     #SetEnvIf Request_URI ".*" OILS_OPAC_STATIC_PROTOCOL=http
130
131     # If you would prefer to fall back to your non-static servers for 
132     # https pages, avoiding mixed-content warnings in client browsers
133     # and are willing to accept some increased server load, set this:
134     #SetEnvIf Request_URI ".*" OILS_OPAC_BYPASS_STATIC_FOR_HTTPS=yes
135
136     # Specify a ChiliFresh account to integrate their services with the OPAC
137     #SetEnv OILS_CHILIFRESH_ACCOUNT
138     #SetEnv OILS_CHILIFRESH_PROFILE
139     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
140     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
141
142     # Specify the initial script URL for Novelist (containing account credentials, etc.)
143     #SetEnv OILS_NOVELIST_URL
144     #
145
146     # Uncomment to force SSL any time a patron is logged in.  This protects 
147     # authentication tokens.  Left commented out for backwards compat for now.
148     #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
149
150     # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js
151     #SetEnv OILS_OPAC_COMBINED_JS 1
152
153 </LocationMatch>
154
155 <Location /opac/>
156     # ----------------------------------------------------------------------------------
157     # Some mod_deflate fun
158     # ----------------------------------------------------------------------------------
159     <IfModule mod_deflate.c>
160         SetOutputFilter DEFLATE
161
162         BrowserMatch ^Mozilla/4 gzip-only-text/html
163         BrowserMatch ^Mozilla/4\.0[678] no-gzip
164         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
165
166         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
167
168         <IfModule mod_headers.c>
169             Header append Vary User-Agent env=!dont-vary
170         </IfModule>
171     </IfModule>
172
173 </Location>
174
175 <Location //opac/>
176     # ----------------------------------------------------------------------------------
177     # Some mod_deflate fun
178     # ----------------------------------------------------------------------------------
179     <IfModule mod_deflate.c>
180         SetOutputFilter DEFLATE
181
182         BrowserMatch ^Mozilla/4 gzip-only-text/html
183         BrowserMatch ^Mozilla/4\.0[678] no-gzip
184         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
185
186         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
187
188         <IfModule mod_headers.c>
189             Header append Vary User-Agent env=!dont-vary
190         </IfModule>
191     </IfModule>
192
193 </Location>
194
195 # ----------------------------------------------------------------------------------
196 # Force SSL on the OPAC's "My Account" page
197 # ----------------------------------------------------------------------------------
198 <LocationMatch .*/myopac.xml>
199     SSLRequireSSL
200 </LocationMatch>
201
202 <LocationMatch /opac/extras/>
203     # Force to en-US for now to satisfy bbags.xml
204     SetEnv locale en-US
205     Options +Includes
206     AddOutputFilter INCLUDES .xml
207     AddType application/xhtml+xml .xml
208 </LocationMatch>
209
210 RewriteCond %{QUERY_STRING} locale=([^&]*)
211 RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
212 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
213     AddOutputFilter INCLUDES;XMLENT .html
214 </LocationMatch>
215
216 # ----------------------------------------------------------------------------------
217 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
218 # ----------------------------------------------------------------------------------
219 RewriteCond %{HTTP:Accept-Language} ^([a-z]{2}-[A-Z]{2})$
220 # Default to en-US if we haven't matched a locale of the form xx-YY 
221 RewriteRule .? - [S=4]
222 RewriteRule ^/xul/      -       [E=locale:en-US]
223 RewriteRule ^/reports/  -       [E=locale:en-US]
224 RewriteRule .? - [E=locale:en-US]
225 RewriteRule .? - [S=3]
226 # Otherwise, set our real locale
227 RewriteRule ^/xul/      -       [E=locale:%{HTTP:Accept-Language}]
228 RewriteRule ^/reports/  -       [E=locale:%{HTTP:Accept-Language}]
229 RewriteRule .? - [E=locale:%{HTTP:Accept-Language}]
230
231 <LocationMatch /xul/.*\.x?html$>
232     Options +Includes
233     XMLEntEscapeScript "no"
234     XMLEntStripComments "yes"
235     XMLEntStripPI "yes"
236     XMLEntStripDoctype "yes"
237     XMLEntContentType "text/html; charset=utf-8"
238     AddOutputFilter INCLUDES;XMLENT .xhtml
239     AddOutputFilter INCLUDES;XMLENT .html
240     SetEnv no-gzip
241     allow from all
242 </LocationMatch>
243
244
245 <LocationMatch /xul/.*\.xul$>
246     Options +Includes
247     XMLEntContentType "application/vnd.mozilla.xul+xml"
248     AddOutputFilter INCLUDES;XMLENT .xul
249     SetEnv no-gzip
250     allow from all
251 </LocationMatch>
252
253 # ----------------------------------------------------------------------------------
254 # Self-serve password interface
255 # ----------------------------------------------------------------------------------
256 <Location /opac/password>
257     SetHandler perl-script
258     PerlHandler OpenILS::WWW::PasswordReset::password_reset
259     Options +ExecCGI
260     PerlSendHeader On
261     allow from all
262
263     # Force clients to use HTTPS
264     RewriteCond %{HTTPS} !=on [NC]
265     RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
266 </Location>
267
268 # ----------------------------------------------------------------------------------
269 # Supercat feeds
270 # ----------------------------------------------------------------------------------
271 <Location /opac/extras/oisbn>
272     SetHandler perl-script
273     PerlHandler OpenILS::WWW::SuperCat::oisbn
274     Options +ExecCGI
275     PerlSendHeader On
276     allow from all
277 </Location>
278 <Location /opac/extras/supercat>
279     SetHandler perl-script
280     PerlHandler OpenILS::WWW::SuperCat::supercat
281     Options +ExecCGI
282     PerlSendHeader On
283     allow from all
284 </Location>
285 <Location /opac/extras/unapi>
286     SetHandler perl-script
287     PerlHandler OpenILS::WWW::SuperCat::unapi
288     Options +ExecCGI
289     PerlSendHeader On
290     allow from all
291 </Location>
292 <Location /opac/extras/feed/bookbag>
293     SetHandler perl-script
294     PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
295     Options +ExecCGI
296     PerlSendHeader On
297     allow from all
298 </Location>
299 <Location /opac/extras/opensearch>
300     SetHandler perl-script
301     PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
302     Options +ExecCGI
303     PerlSendHeader On
304     allow from all
305 </Location>
306 <Location /opac/extras/sru>
307     SetHandler perl-script
308     PerlHandler OpenILS::WWW::SuperCat::sru_search
309     Options +ExecCGI
310     PerlSendHeader On
311     allow from all
312 </Location>
313 <Location /opac/extras/sru_auth>
314     SetHandler perl-script
315     PerlHandler OpenILS::WWW::SuperCat::sru_auth_search
316     Options +ExecCGI
317     PerlSendHeader On
318     allow from all
319 </Location>
320 <Location /opac/extras/feed/freshmeat>
321     SetHandler perl-script
322     PerlHandler OpenILS::WWW::SuperCat::changes_feed
323     Options +ExecCGI
324     PerlSendHeader On
325     allow from all
326 </Location>
327 <Location /opac/extras/browse>
328     SetHandler perl-script
329     PerlHandler OpenILS::WWW::SuperCat::string_browse
330     Options +ExecCGI
331     PerlSendHeader On
332     allow from all
333 </Location>     
334 <Location /opac/extras/startwith>
335     SetHandler perl-script
336     PerlHandler OpenILS::WWW::SuperCat::string_startwith
337     Options +ExecCGI
338     PerlSendHeader On
339     allow from all
340 </Location>     
341         
342 # ----------------------------------------------------------------------------------
343 # Module for displaying OpenSRF API documentation
344 # ----------------------------------------------------------------------------------
345 <Location /opac/extras/docgen.xsl>
346     AddOutputFilter INCLUDES .xsl
347 </Location>
348
349 # ----------------------------------------------------------------------------------
350 # Module for processing staff-client offline scripts lives here
351 # ----------------------------------------------------------------------------------
352 <Directory "/openils/var/cgi-bin/offline">
353     AddHandler cgi-script .pl
354     AllowOverride None
355     Options +ExecCGI
356     allow from all
357 </Directory>
358         
359         
360 # ----------------------------------------------------------------------------------
361 # XXX Note, it's important to explicitly set the JSON encoding style 
362 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change 
363 # with OpenSRF 1.0
364 # ----------------------------------------------------------------------------------
365 # OpenSRF JSON legacy gateway
366 # ----------------------------------------------------------------------------------
367 <Location /gateway>
368     SetHandler osrf_json_gateway_module
369     OSRFGatewayLegacyJSON "true"
370     allow from all
371 </Location>
372 # ----------------------------------------------------------------------------------
373 # New-style OpenSRF JSON gateway
374 # ----------------------------------------------------------------------------------
375 <Location /osrf-gateway-v1>
376     SetHandler osrf_json_gateway_module
377     OSRFGatewayLegacyJSON "false"
378     allow from all
379 </Location>
380
381 # ----------------------------------------------------------------------------------
382 # OpenSRF-over-HTTP translator
383 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
384 # ----------------------------------------------------------------------------------
385 <Location /osrf-http-translator>
386     SetHandler osrf_http_translator_module
387     allow from all
388 </Location>
389
390 # ----------------------------------------------------------------------------------
391 # The exporter lives here
392 # ----------------------------------------------------------------------------------
393 <Location /exporter>
394     SetHandler perl-script
395     AuthType Basic
396     AuthName "Exporter Login"
397     PerlOptions +GlobalRequest
398     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
399     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
400     require valid-user
401     PerlHandler OpenILS::WWW::Exporter
402     Options +ExecCGI
403     PerlSendHeader On
404     allow from all
405 </Location>
406
407 <Location /opac/extras/merge_template>
408     SetHandler perl-script
409     AuthType Basic
410     AuthName "Batch Update Login"
411     PerlOptions +GlobalRequest
412     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
413     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
414     require valid-user
415     PerlHandler OpenILS::WWW::TemplateBatchBibUpdate
416     PerlSendHeader On
417     Options +ExecCGI
418     allow from all
419 </Location>
420
421 <Location /opac/extras/circ>
422     AuthType Basic
423     AuthName "Circ Extras Login"
424     PerlOptions +GlobalRequest
425     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
426     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
427     require valid-user
428     Options +ExecCGI
429     PerlSendHeader On
430     allow from all
431 </Location>
432
433 <Location /collections>
434     SetHandler perl-script
435     AuthType Basic
436     AuthName "Collections Login"
437     PerlOptions +GlobalRequest
438     PerlSetVar OILSProxyPermissions "money.collections_tracker.create"
439     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
440     require valid-user
441     Options +ExecCGI
442     PerlSendHeader On
443     allow from all
444 </Location>
445
446
447 # ----------------------------------------------------------------------------------
448 # Reporting output lives here
449 # ----------------------------------------------------------------------------------
450 <Location /reporter/>
451     AuthType Basic
452     AuthName "Report Login"
453     PerlOptions +GlobalRequest
454     PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
455     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
456     require valid-user
457     Options +ExecCGI
458     PerlSendHeader On
459     allow from all
460 </Location>
461
462 # ----------------------------------------------------------------------------------
463 # Selfcheck interface
464 # ----------------------------------------------------------------------------------
465 <LocationMatch .*/selfcheck.xml>
466     AuthType Basic
467     AuthName "Self-check Login"
468     PerlOptions +GlobalRequest
469     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
470     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
471     require valid-user
472     Options +ExecCGI
473     PerlSendHeader On
474     allow from all
475 </LocationMatch>
476
477
478 # ----------------------------------------------------------------------------------
479 # Reports GUI
480 # ----------------------------------------------------------------------------------
481 <LocationMatch /reports>
482     Options +Includes
483     AddOutputFilter INCLUDES;XMLENT .xhtml
484 </LocationMatch>
485
486 <LocationMatch /reports/fm_IDL.xml>
487     IDLChunkStripPI "yes"
488     IDLChunkEscapeScript "no"
489     IDLChunkStripComments "yes"
490     IDLChunkStripDoctype "yes"
491     IDLChunkContentType "application/xml; charset=utf-8"
492     AddOutputFilter INCLUDES;IDLCHUNK .xml
493 </LocationMatch>
494
495 # ----------------------------------------------------------------------------------
496 # EDI Message viewer
497 # ----------------------------------------------------------------------------------
498 <Location /edi>
499     SetHandler perl-script
500     PerlHandler OpenILS::WWW::EDI
501     Options +ExecCGI
502     PerlSendHeader On
503     allow from all
504 </Location>     
505
506 # ----------------------------------------------------------------------------------
507 # XML-RPC gateway
508 # ----------------------------------------------------------------------------------
509 <Location /xml-rpc>
510     SetHandler perl-script
511     PerlHandler OpenILS::WWW::XMLRPCGateway
512     Options +ExecCGI
513     PerlSendHeader On
514     allow from all
515 </Location>
516
517 # ----------------------------------------------------------------------------------
518 # Conify - next-generation Evergreen administration interface
519 # ----------------------------------------------------------------------------------
520 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
521 <Location /conify>
522     Options +Includes
523     XMLEntStripPI "yes"
524     XMLEntEscapeScript "no"
525     XMLEntStripComments "no"
526     XMLEntContentType "text/html; charset=utf-8"
527     AddOutputFilter INCLUDES;XMLENT .html
528  
529     AuthType Basic
530     AuthName "Dojo Admin Login"
531     PerlOptions +GlobalRequest
532     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
533     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
534     require valid-user
535     Options +ExecCGI
536     PerlSendHeader On
537     allow from all
538 </Location>
539
540 <Location /vandelay-upload>
541     SetHandler perl-script
542     PerlHandler OpenILS::WWW::Vandelay::spool_marc
543     Options +ExecCGI
544     allow from all
545 </Location>
546
547 # OpenURL 0.1 searching based on OpenSearch
548 RewriteMap openurl prg:/openils/bin/openurl_map.pl
549 RewriteCond %{QUERY_STRING} (^.*$)
550 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
551
552
553
554 # General Evergreen web template processor
555 <Location /eg>
556     SetHandler perl-script
557     PerlHandler OpenILS::WWW::EGWeb
558     Options +ExecCGI
559     PerlSendHeader On
560     allow from all
561
562     PerlSetVar OILSWebBasePath "/eg"
563     PerlSetVar OILSWebWebDir "/openils/var/web"
564     PerlSetVar OILSWebDefaultTemplateExtension "tt2"
565
566     # Enable Template-Toolkit error debugging messages (apache error log)
567     PerlSetVar OILSWebDebugTemplate "true"
568
569     # -------------------------------------------------------
570     # Media Prefix.  In the 3rd example, the protocol (http) is enforced
571     #PerlSetVar OILSWebMediaPrefix "/media"
572     #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
573     #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
574
575     # Locale messages files:
576     #
577     # These appear in pairs; the first represents the user agent
578     # Accept-Language header locale, and the second represents
579     # the fully-qualified path for the corresponding PO file that
580     # contains the messages.
581     #
582     # If you enable two or more locales, then users will be able to
583     # select their preferred locale from a locale picker in the TPAC.
584     #
585     #PerlAddVar OILSWebLocale "en"
586     #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en.po"
587     #PerlAddVar OILSWebLocale "en_ca"
588     #PerlAddVar OILSWebLocale "/openils/var/data/locale/en-CA.po"
589     #PerlAddVar OILSWebLocale "fr_ca"
590     #PerlAddVar OILSWebLocale "/openils/var/data/locale/fr-CA.po"
591
592     # Set the default locale: defaults to en-US
593     #PerlAddVar OILSWebDefaultLocale "fr_ca"
594     
595     # Templates will be loaded from the following paths in reverse order.
596     PerlAddVar OILSWebTemplatePath "/openils/var/templates"
597     #PerlAddVar OILSWebTemplatePath "/openils/var/templates_localskin"
598
599     #-------------------------------------------------
600     # Added Content Configuration
601     #-------------------------------------------------
602     # Content Cafe
603     #SetEnv OILS_CONTENT_CAFE_USER MYUSER
604     #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
605     
606     # LibraryThing
607     #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
608     #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
609     
610     # ChiliFresh
611     #SetEnv OILS_CHILIFRESH_ACCOUNT
612     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
613     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
614     #-------------------------------------------------
615
616     <IfModule mod_deflate.c>
617         SetOutputFilter DEFLATE
618         BrowserMatch ^Mozilla/4 gzip-only-text/html
619         BrowserMatch ^Mozilla/4\.0[678] no-gzip
620         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
621         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
622         <IfModule mod_headers.c>
623             Header append Cache-Control "public"
624             Header append Vary User-Agent env=!dont-vary
625         </IfModule>
626     </IfModule>
627 </Location>
628 <LocationMatch ^/(images|css|js)/>
629     # should pick up the default expire time from eg.conf...
630     <IfModule mod_deflate.c>
631         SetOutputFilter DEFLATE
632         BrowserMatch ^Mozilla/4 gzip-only-text/html
633         BrowserMatch ^Mozilla/4\.0[678] no-gzip
634         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
635         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
636         <IfModule mod_headers.c>
637             Header append Cache-Control "public"
638             Header append Vary User-Agent env=!dont-vary
639         </IfModule>
640     </IfModule>
641 </LocationMatch>
642 <Location /eg/opac>
643     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
644     # Expire the HTML quickly since we're loading dynamic data for each page
645     ExpiresActive On
646     ExpiresByType text/html "access plus 5 seconds"
647 </Location>
648 <Location /eg/kpac>
649     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader"
650     PerlSetVar KPacConfigFile "/openils/conf/kpac.xml.example"
651     ExpiresActive On
652     ExpiresByType text/html "access plus 5 seconds"
653 </Location>
654
655 # Note: the template processor will decline handling anything it does not
656 # have an explicit configuration for, which means it will fall back to 
657 # Apache to serve the file.  However, in the interest of speed, go ahead 
658 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
659 # Add more exemptions as needed.
660 <LocationMatch ^/eg/.*(\.js|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
661     SetHandler None
662 </LocationMatch>
663
664 # ----------------------------------------------------------------------------------
665 # Some mod_deflate logging setup
666 # ----------------------------------------------------------------------------------
667 <IfModule mod_deflate.c>
668     DeflateFilterNote Input instream
669     DeflateFilterNote Output outstream
670     DeflateFilterNote Ratio ratio
671
672     LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
673     CustomLog /var/log/apache2/deflate_log deflate
674
675     # There are problems with XMLENT and mod_deflate - so lets disable it
676     # This is where we don't have a pre-existing LocationMatch directive earlier
677     <LocationMatch /opac/.*\.xml$>
678         SetEnv no-gzip
679     </LocationMatch>
680     <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
681         SetEnv no-gzip
682     </LocationMatch>
683     <LocationMatch /reports/.*\.xhtml$>
684         SetEnv no-gzip
685     </LocationMatch>
686     <LocationMatch /conify/.*\.html$>
687         SetEnv no-gzip
688     </LocationMatch>
689 </IfModule>
690
691
692 <Location /IDL2js>
693
694     SetHandler perl-script
695     PerlHandler OpenILS::WWW::IDL2js
696     Options +ExecCGI
697     PerlSendHeader On
698     allow from all
699
700     <IfModule mod_headers.c>
701         Header append Cache-Control "public"
702     </IFModule>
703
704     <IfModule mod_deflate.c>
705         SetOutputFilter DEFLATE
706         BrowserMatch ^Mozilla/4 gzip-only-text/html
707         BrowserMatch ^Mozilla/4\.0[678] no-gzip
708         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
709         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
710         <IfModule mod_headers.c>
711             Header append Vary User-Agent env=!dont-vary
712         </IfModule>
713     </IfModule>
714 </Location>
715
716 # Uncomment the following to force SSL for everything. Note that this defeats caching
717 # and you will suffer a performance hit.
718 #RewriteCond %{HTTPS} off
719 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]