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