]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/apache/eg_vhost.conf
LP#1207281: require SSL when downloading offline patron list
[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 # Protect Standalone/Offline mode files from public view
448 # ----------------------------------------------------------------------------------
449 <Location /standalone/>
450     AuthType Basic
451     AuthName "Standalone Mode Login"
452     PerlOptions +GlobalRequest
453     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
454     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
455     require valid-user
456     PerlSendHeader On
457     allow from all
458     SSLRequireSSL
459 </Location>
460
461 # ----------------------------------------------------------------------------------
462 # Reporting output lives here
463 # ----------------------------------------------------------------------------------
464 <Location /reporter/>
465     AuthType Basic
466     AuthName "Report Login"
467     PerlOptions +GlobalRequest
468     PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
469     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
470     require valid-user
471     Options +ExecCGI
472     PerlSendHeader On
473     allow from all
474 </Location>
475
476 # ----------------------------------------------------------------------------------
477 # Selfcheck interface
478 # ----------------------------------------------------------------------------------
479 <LocationMatch .*/selfcheck.xml>
480     AuthType Basic
481     AuthName "Self-check Login"
482     PerlOptions +GlobalRequest
483     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
484     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
485     require valid-user
486     Options +ExecCGI
487     PerlSendHeader On
488     allow from all
489 </LocationMatch>
490
491
492 # ----------------------------------------------------------------------------------
493 # Reports GUI
494 # ----------------------------------------------------------------------------------
495 <LocationMatch /reports>
496     Options +Includes
497     AddOutputFilter INCLUDES;XMLENT .xhtml
498 </LocationMatch>
499
500 <LocationMatch /reports/fm_IDL.xml>
501     IDLChunkStripPI "yes"
502     IDLChunkEscapeScript "no"
503     IDLChunkStripComments "yes"
504     IDLChunkStripDoctype "yes"
505     IDLChunkContentType "application/xml; charset=utf-8"
506     AddOutputFilter INCLUDES;IDLCHUNK .xml
507 </LocationMatch>
508
509 # ----------------------------------------------------------------------------------
510 # EDI Message viewer
511 # ----------------------------------------------------------------------------------
512 <Location /edi>
513     SetHandler perl-script
514     PerlHandler OpenILS::WWW::EDI
515     Options +ExecCGI
516     PerlSendHeader On
517     allow from all
518 </Location>     
519
520 # ----------------------------------------------------------------------------------
521 # XML-RPC gateway
522 # ----------------------------------------------------------------------------------
523 <Location /xml-rpc>
524     SetHandler perl-script
525     PerlHandler OpenILS::WWW::XMLRPCGateway
526     Options +ExecCGI
527     PerlSendHeader On
528     allow from all
529 </Location>
530
531 # ----------------------------------------------------------------------------------
532 # Conify - next-generation Evergreen administration interface
533 # ----------------------------------------------------------------------------------
534 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
535 <Location /conify>
536     Options +Includes
537     XMLEntStripPI "yes"
538     XMLEntEscapeScript "no"
539     XMLEntStripComments "no"
540     XMLEntContentType "text/html; charset=utf-8"
541     AddOutputFilter INCLUDES;XMLENT .html
542  
543     AuthType Basic
544     AuthName "Dojo Admin Login"
545     PerlOptions +GlobalRequest
546     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
547     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
548     require valid-user
549     Options +ExecCGI
550     PerlSendHeader On
551     allow from all
552 </Location>
553
554 <Location /vandelay-upload>
555     SetHandler perl-script
556     PerlHandler OpenILS::WWW::Vandelay::spool_marc
557     Options +ExecCGI
558     allow from all
559 </Location>
560
561 # OpenURL 0.1 searching based on OpenSearch
562 RewriteMap openurl prg:/openils/bin/openurl_map.pl
563 RewriteCond %{QUERY_STRING} (^.*$)
564 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
565
566
567
568 # General Evergreen web template processor
569 <Location /eg>
570     SetHandler perl-script
571     PerlHandler OpenILS::WWW::EGWeb
572     Options +ExecCGI
573     PerlSendHeader On
574     allow from all
575
576     PerlSetVar OILSWebBasePath "/eg"
577     PerlSetVar OILSWebWebDir "/openils/var/web"
578     PerlSetVar OILSWebDefaultTemplateExtension "tt2"
579
580     # Enable Template-Toolkit error debugging messages (apache error log)
581     PerlSetVar OILSWebDebugTemplate "true"
582
583     # -------------------------------------------------------
584     # Media Prefix.  In the 3rd example, the protocol (http) is enforced
585     #PerlSetVar OILSWebMediaPrefix "/media"
586     #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
587     #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
588
589     # Locale messages files:
590     #
591     # These appear in pairs; the first represents the user agent
592     # Accept-Language header locale, and the second represents
593     # the fully-qualified path for the corresponding PO file that
594     # contains the messages.
595     #
596     # If you enable two or more locales, then users will be able to
597     # select their preferred locale from a locale picker in the TPAC.
598     #
599     #PerlAddVar OILSWebLocale "en"
600     #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en.po"
601     #PerlAddVar OILSWebLocale "en_ca"
602     #PerlAddVar OILSWebLocale "/openils/var/data/locale/en-CA.po"
603     #PerlAddVar OILSWebLocale "fr_ca"
604     #PerlAddVar OILSWebLocale "/openils/var/data/locale/fr-CA.po"
605
606     # Set the default locale: defaults to en-US
607     #PerlAddVar OILSWebDefaultLocale "fr_ca"
608     
609     # Templates will be loaded from the following paths in reverse order.
610     PerlAddVar OILSWebTemplatePath "/openils/var/templates"
611     #PerlAddVar OILSWebTemplatePath "/openils/var/templates_localskin"
612
613     #-------------------------------------------------
614     # Added Content Configuration
615     #-------------------------------------------------
616     # Content Cafe
617     #SetEnv OILS_CONTENT_CAFE_USER MYUSER
618     #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
619     
620     # LibraryThing
621     #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
622     #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
623     
624     # ChiliFresh
625     #SetEnv OILS_CHILIFRESH_ACCOUNT
626     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
627     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
628     #-------------------------------------------------
629
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 </Location>
642 <LocationMatch ^/(images|css|js)/>
643     # should pick up the default expire time from eg.conf...
644     <IfModule mod_deflate.c>
645         SetOutputFilter DEFLATE
646         BrowserMatch ^Mozilla/4 gzip-only-text/html
647         BrowserMatch ^Mozilla/4\.0[678] no-gzip
648         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
649         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
650         <IfModule mod_headers.c>
651             Header append Cache-Control "public"
652             Header append Vary User-Agent env=!dont-vary
653         </IfModule>
654     </IfModule>
655 </LocationMatch>
656 <Location /eg/opac>
657     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
658     # Expire the HTML quickly since we're loading dynamic data for each page
659     ExpiresActive On
660     ExpiresByType text/html "access plus 5 seconds"
661 </Location>
662 <Location /eg/kpac>
663     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader"
664     PerlSetVar KPacConfigFile "/openils/conf/kpac.xml.example"
665     ExpiresActive On
666     ExpiresByType text/html "access plus 5 seconds"
667 </Location>
668
669 # Note: the template processor will decline handling anything it does not
670 # have an explicit configuration for, which means it will fall back to 
671 # Apache to serve the file.  However, in the interest of speed, go ahead 
672 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
673 # Add more exemptions as needed.
674 <LocationMatch ^/eg/.*(\.js|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
675     SetHandler None
676 </LocationMatch>
677
678 # ----------------------------------------------------------------------------------
679 # Some mod_deflate logging setup
680 # ----------------------------------------------------------------------------------
681 <IfModule mod_deflate.c>
682     DeflateFilterNote Input instream
683     DeflateFilterNote Output outstream
684     DeflateFilterNote Ratio ratio
685
686     LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
687     CustomLog /var/log/apache2/deflate_log deflate
688
689     # There are problems with XMLENT and mod_deflate - so lets disable it
690     # This is where we don't have a pre-existing LocationMatch directive earlier
691     <LocationMatch /opac/.*\.xml$>
692         SetEnv no-gzip
693     </LocationMatch>
694     <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
695         SetEnv no-gzip
696     </LocationMatch>
697     <LocationMatch /reports/.*\.xhtml$>
698         SetEnv no-gzip
699     </LocationMatch>
700     <LocationMatch /conify/.*\.html$>
701         SetEnv no-gzip
702     </LocationMatch>
703 </IfModule>
704
705
706 <Location /IDL2js>
707
708     SetHandler perl-script
709     PerlHandler OpenILS::WWW::IDL2js
710     Options +ExecCGI
711     PerlSendHeader On
712     allow from all
713
714     <IfModule mod_headers.c>
715         Header append Cache-Control "public"
716     </IFModule>
717
718     <IfModule mod_deflate.c>
719         SetOutputFilter DEFLATE
720         BrowserMatch ^Mozilla/4 gzip-only-text/html
721         BrowserMatch ^Mozilla/4\.0[678] no-gzip
722         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
723         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
724         <IfModule mod_headers.c>
725             Header append Vary User-Agent env=!dont-vary
726         </IfModule>
727     </IfModule>
728 </Location>
729
730 # Uncomment the following to force SSL for everything. Note that this defeats caching
731 # and you will suffer a performance hit.
732 #RewriteCond %{HTTPS} off
733 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]