LP2008252: Fix report output access when Shibboleth is enabled
[evergreen-equinox.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 RewriteRule ^/$ %{REQUEST_SCHEME}://%{HTTP_HOST}/eg/opac/home [R=301,L]
10
11 # ----------------------------------------------------------------------------------
12 # Redirect staff to the correct URL if they forget to include the final /
13 # ----------------------------------------------------------------------------------
14 RewriteRule ^/eg/staff$ https://%{HTTP_HOST}/eg/staff/ [R=301,L]
15
16 # ----------------------------------------------------------------------------------
17 # Point / to the IP address redirector
18 # ----------------------------------------------------------------------------------
19 #<LocationMatch ^/$>
20 #    SetHandler perl-script
21 #    PerlHandler OpenILS::WWW::Redirect
22 #    Options +ExecCGI
23 #    PerlSendHeader On
24 #    #PerlSetVar OILSRedirectSkin "default"
25 #    # OILSRedirectDepth defaults to the depth of the branch that the OPAC was directed to
26 #    #PerlSetVar OILSRedirectDepth "0"
27 #    #PerlSetVar OILSRedirectLocale "en-US"
28 #    # Use the template-toolkit opac
29 #    #PerlSetVar OILSRedirectTpac "true"
30 #    allow from all
31 #</LocationMatch>
32
33
34 # ----------------------------------------------------------------------------------
35 # Assign a default locale to the accessible OPAC
36 # ----------------------------------------------------------------------------------
37 RewriteRule ^/opac/extras/slimpac/start.html$ %{REQUEST_SCHEME}://%{HTTP_HOST}/opac/en-US/extras/slimpac/start.html [R=301,L]
38 RewriteRule ^/opac/extras/slimpac/advanced.html$ %{REQUEST_SCHEME}://%{HTTP_HOST}/opac/en-US/extras/slimpac/advanced.html [R=301,L]
39
40 # ----------------------------------------------------------------------------------
41 # Configure the gateway and translator
42 # ----------------------------------------------------------------------------------
43 OSRFGatewayConfig @sysconfdir@/opensrf_core.xml
44 OSRFTranslatorConfig @sysconfdir@/opensrf_core.xml
45 # Translator memcache server.  Default is localhost
46 # OSRFTranslatorCacheServer 127.0.0.1:11211
47
48 # ----------------------------------------------------------------------------------
49 # Log redaction
50 # ----------------------------------------------------------------------------------
51 <Location />
52     # handler for redacting URL query parameters from
53     # the access log
54     PerlLogHandler OpenILS::WWW::EGWeb::log_handler
55     PerlAddVar OILSUrlParamToRedact "geographic-location"
56 </Location>
57
58 # ----------------------------------------------------------------------------------
59 # Added content plugin
60 # ----------------------------------------------------------------------------------
61 <Location /opac/extras/ac/>
62     SetHandler perl-script
63     PerlHandler OpenILS::WWW::AddedContent
64     Options +ExecCGI
65     PerlSendHeader On
66     Require all granted 
67 </Location>
68
69 # Lock clearing cache down to STAFF_LOGIN
70 <Location /opac/extras/ac/clearcache/>
71     PerlAccessHandler OpenILS::WWW::AccessHandler
72     PerlSetVar OILSAccessHandlerPermission "STAFF_LOGIN"
73 </Location>
74
75 # Autosuggest for searches
76 <Location /opac/extras/autosuggest>
77     SetHandler perl-script
78     PerlHandler OpenILS::WWW::AutoSuggest
79     PerlSendHeader On
80     Require all granted 
81 </Location>
82
83 # Flattener service
84 <Location /opac/extras/flattener>
85     SetHandler perl-script
86     PerlHandler OpenILS::WWW::FlatFielder
87     PerlSendHeader On
88     Require all granted 
89 </Location>
90
91 # Uncomment this section to enable the OAI2 provider service.
92 #<Location /opac/extras/oai>
93 #    SetHandler perl-script
94 #    PerlHandler OpenILS::WWW::SuperCat::OAI
95 #    Options +ExecCGI
96 #    PerlSendHeader On
97 #    Require all granted
98 #</Location>
99
100 # ----------------------------------------------------------------------------------
101 # Replace broken cover images with a transparent GIF by default
102 # ----------------------------------------------------------------------------------
103 RewriteEngine ON
104 RewriteRule ^/opac/extras/ac/jacket/(small|medium|large)/$ \
105     /opac/images/blank.png [P,L]
106
107 <Location /opac/extras/ac/jacket>
108         ErrorDocument 404 /opac/images/blank.png
109 </Location>
110
111 # Uncomment one or more of these to have a "no image" image other than the blank
112 # image above.
113
114 # Note: There are no default images provided for these, you will need to provide
115 # your own "no image" image(s).
116
117 #<Location /opac/extras/ac/jacket/small>
118 #        ErrorDocument 404 /opac/images/noimage_small.png
119 #</Location>
120
121 #<Location /opac/extras/ac/jacket/medium>
122 #        ErrorDocument 404 /opac/images/noimage_medium.png
123 #</Location>
124
125 #<Location /opac/extras/ac/jacket/large>
126 #        ErrorDocument 404 /opac/images/noimage_large.png
127 #</Location>
128
129 # ----------------------------------------------------------------------------------
130 # Add the row ID (RID) and date so we can make unAPI happy
131 # ----------------------------------------------------------------------------------
132 RewriteCond %{QUERY_STRING} (^r|&r)=(\d+)
133 RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}]
134
135 # ----------------------------------------------------------------------------------
136 # Pull the locale from the URL
137 # ----------------------------------------------------------------------------------
138 RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
139 RewriteRule . - [E=locale:%1]
140
141 # ----------------------------------------------------------------------------------
142 # Rewrite JSPac->TPac with redirects
143 # ----------------------------------------------------------------------------------
144 # My Account
145 RewriteRule /opac/[^/]*/skin/default/xml/myopac.xml %{REQUEST_SCHEME}://%{HTTP_HOST}/eg/opac/myopac/main?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
146
147 # -----------------------------------------------------------------------------$
148 # Force HTTPS for /eg/circ/selfcheck
149 # -----------------------------------------------------------------------------$
150 RewriteCond %{HTTPS} off
151 RewriteRule ^(/eg/circ/selfcheck) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L]
152
153 # ----------------------------------------------------------------------------------
154 # For sanity reasons, default indexes to Off
155 # ----------------------------------------------------------------------------------
156 Options -Indexes
157
158 # ----------------------------------------------------------------------------------
159 # Configure the OPAC
160 # ----------------------------------------------------------------------------------
161 <LocationMatch /opac/>
162     SSILegacyExprParser on
163     AddType application/xhtml+xml .xml
164    
165     # - configure mod_xmlent
166     XMLEntStripPI "yes"
167     XMLEntEscapeScript "no"
168     XMLEntStripComments "yes"
169     XMLEntContentType "text/html; charset=utf-8"
170     # forces quirks mode which we want for now
171     XMLEntStripDoctype "yes" 
172
173     # - set up the include handlers
174     Options +Includes
175     AddOutputFilter INCLUDES .xsl
176     AddOutputFilter INCLUDES;XMLENT .xml
177                     
178     SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
179     
180     # This gives you the option to configure a different host to serve OPAC images from
181     # Specify the hostname (without protocol) and path to the images.  Protocol will
182     # be determined at runtime
183     #SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=static.example.org/opac/
184
185     # In addition to loading images from a static host, you can also load CSS and/or
186     # Javascript from a static host or hosts. Protocol will be determined at runtime
187     # and/or by configuration options immediately following.
188     #SetEnvIf Request_URI ".*" OILS_OPAC_CSS_HOST=static.example.org/opac/
189     #SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=static.example.org/opac/
190
191     # If you are not able to serve static content via https and 
192     # wish to force http:// (and are comfortable with mixed-content
193     # warnings in client browsers), set this:
194     #SetEnvIf Request_URI ".*" OILS_OPAC_STATIC_PROTOCOL=http
195
196     # If you would prefer to fall back to your non-static servers for 
197     # https pages, avoiding mixed-content warnings in client browsers
198     # and are willing to accept some increased server load, set this:
199     #SetEnvIf Request_URI ".*" OILS_OPAC_BYPASS_STATIC_FOR_HTTPS=yes
200
201     # Specify a ChiliFresh account to integrate their services with the OPAC
202     #SetEnv OILS_CHILIFRESH_ACCOUNT
203     #SetEnv OILS_CHILIFRESH_PROFILE
204     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
205     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
206
207     # Specify the initial script URL for Novelist (containing account credentials, etc.)
208     #SetEnv OILS_NOVELIST_URL
209     #SetEnv OILS_NOVELIST_PROFILE
210     #SetEnv OILS_NOVELIST_PASSWORD
211
212     # Uncomment to force SSL any time a patron is logged in.  This protects 
213     # authentication tokens.  Left commented out for backwards compat for now.
214     #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
215
216     # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js
217     #SetEnv OILS_OPAC_COMBINED_JS 1
218
219 </LocationMatch>
220
221 <Location /opac/>
222     # ----------------------------------------------------------------------------------
223     # Some mod_deflate fun
224     # ----------------------------------------------------------------------------------
225     <IfModule mod_deflate.c>
226         SetOutputFilter DEFLATE
227
228         BrowserMatch ^Mozilla/4 gzip-only-text/html
229         BrowserMatch ^Mozilla/4\.0[678] no-gzip
230         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
231
232         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
233
234         <IfModule mod_headers.c>
235             Header append Vary User-Agent env=!dont-vary
236         </IfModule>
237     </IfModule>
238
239 </Location>
240
241 <Location //opac/>
242     # ----------------------------------------------------------------------------------
243     # Some mod_deflate fun
244     # ----------------------------------------------------------------------------------
245     <IfModule mod_deflate.c>
246         SetOutputFilter DEFLATE
247
248         BrowserMatch ^Mozilla/4 gzip-only-text/html
249         BrowserMatch ^Mozilla/4\.0[678] no-gzip
250         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
251
252         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
253
254         <IfModule mod_headers.c>
255             Header append Vary User-Agent env=!dont-vary
256         </IfModule>
257     </IfModule>
258
259 </Location>
260
261 # ----------------------------------------------------------------------------------
262 # Force SSL on the OPAC's "My Account" page
263 # ----------------------------------------------------------------------------------
264 <LocationMatch .*/myopac.xml>
265     SSLRequireSSL
266 </LocationMatch>
267
268 RewriteCond %{QUERY_STRING} locale=([^&]*)
269 RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ %{REQUEST_SCHEME}://%{HTTP_HOST}/opac/%1/extras/slimpac/$1? [redirect]
270 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
271     AddOutputFilter INCLUDES;XMLENT .html
272 </LocationMatch>
273
274 # ----------------------------------------------------------------------------------
275 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
276 # ----------------------------------------------------------------------------------
277 RewriteCond %{HTTP:Accept-Language} ^([a-z]{2}-[A-Z]{2})$
278 # Default to en-US if we haven't matched a locale of the form xx-YY 
279 RewriteRule .? - [S=4]
280 RewriteRule ^/xul/      -       [E=locale:en-US]
281 RewriteRule ^/reports/  -       [E=locale:en-US]
282 RewriteRule .? - [E=locale:en-US]
283 RewriteRule .? - [S=3]
284 # Otherwise, set our real locale
285 RewriteRule ^/xul/      -       [E=locale:%{HTTP:Accept-Language}]
286 RewriteRule ^/reports/  -       [E=locale:%{HTTP:Accept-Language}]
287 RewriteRule .? - [E=locale:%{HTTP:Accept-Language}]
288
289 <LocationMatch /xul/.*\.x?html$>
290     SSILegacyExprParser on
291     Options +Includes
292     XMLEntEscapeScript "no"
293     XMLEntStripComments "yes"
294     XMLEntStripPI "yes"
295     XMLEntStripDoctype "yes"
296     XMLEntContentType "text/html; charset=utf-8"
297     AddOutputFilter INCLUDES;XMLENT .xhtml
298     AddOutputFilter INCLUDES;XMLENT .html
299     SetEnv no-gzip
300     Require all granted 
301 </LocationMatch>
302
303
304 <LocationMatch /xul/.*\.xul$>
305     SSILegacyExprParser on
306     Options +Includes
307     XMLEntContentType "application/vnd.mozilla.xul+xml"
308     AddOutputFilter INCLUDES;XMLENT .xul
309     SetEnv no-gzip
310     Require all granted 
311 </LocationMatch>
312
313 # ----------------------------------------------------------------------------------
314 # Supercat feeds
315 # ----------------------------------------------------------------------------------
316 <Location /opac/extras/oisbn>
317     SetHandler perl-script
318     PerlHandler OpenILS::WWW::SuperCat::oisbn
319     Options +ExecCGI
320     PerlSendHeader On
321     Require all granted 
322 </Location>
323 <Location /opac/extras/supercat>
324     SetHandler perl-script
325     PerlHandler OpenILS::WWW::SuperCat::supercat
326     Options +ExecCGI
327     PerlSendHeader On
328     Require all granted 
329 </Location>
330 <Location /opac/extras/unapi>
331     SetHandler perl-script
332     PerlHandler OpenILS::WWW::SuperCat::unapi
333     Options +ExecCGI
334     PerlSendHeader On
335     Require all granted 
336 </Location>
337 <Location /opac/extras/feed/bookbag>
338     SetHandler perl-script
339     PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
340     Options +ExecCGI
341     PerlSendHeader On
342     Require all granted 
343 </Location>
344 <Location /opac/extras/opensearch>
345     SetHandler perl-script
346     PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
347     Options +ExecCGI
348     PerlSendHeader On
349     Require all granted 
350 </Location>
351 <Location /opac/extras/sru>
352     SetHandler perl-script
353     PerlHandler OpenILS::WWW::SuperCat::sru_search
354     Options +ExecCGI
355     PerlSendHeader On
356     Require all granted 
357 </Location>
358 <Location /opac/extras/sru_auth>
359     SetHandler perl-script
360     PerlHandler OpenILS::WWW::SuperCat::sru_auth_search
361     Options +ExecCGI
362     PerlSendHeader On
363     Require all granted 
364 </Location>
365 <Location /opac/extras/feed/freshmeat>
366     SetHandler perl-script
367     PerlHandler OpenILS::WWW::SuperCat::changes_feed
368     Options +ExecCGI
369     PerlSendHeader On
370     Require all granted 
371 </Location>
372 <Location /opac/extras/browse>
373     SetHandler perl-script
374     PerlHandler OpenILS::WWW::SuperCat::string_browse
375     Options +ExecCGI
376     PerlSendHeader On
377     Require all granted 
378 </Location>     
379 <Location /opac/extras/startwith>
380     SetHandler perl-script
381     PerlHandler OpenILS::WWW::SuperCat::string_startwith
382     Options +ExecCGI
383     PerlSendHeader On
384     Require all granted 
385 </Location>     
386         
387 # ----------------------------------------------------------------------------------
388 # Module for displaying OpenSRF API documentation
389 # ----------------------------------------------------------------------------------
390 <Location /opac/extras/docgen.xsl>
391     AddOutputFilter INCLUDES .xsl
392 </Location>
393
394 # ----------------------------------------------------------------------------------
395 # Module for processing staff-client offline scripts lives here
396 # ----------------------------------------------------------------------------------
397 <Directory "@localstatedir@/cgi-bin/offline">
398     AddHandler cgi-script .pl
399     AllowOverride None
400     Options +ExecCGI
401     Require all granted 
402 </Directory>
403         
404         
405 # ----------------------------------------------------------------------------------
406 # XXX Note, it's important to explicitly set the JSON encoding style 
407 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change 
408 # with OpenSRF 1.0
409 # ----------------------------------------------------------------------------------
410 # OpenSRF JSON legacy gateway
411 # ----------------------------------------------------------------------------------
412 <Location /gateway>
413     SetHandler osrf_json_gateway_module
414     OSRFGatewayLegacyJSON "true"
415     Require all granted 
416 </Location>
417 # ----------------------------------------------------------------------------------
418 # New-style OpenSRF JSON gateway
419 # ----------------------------------------------------------------------------------
420 <Location /osrf-gateway-v1>
421     SetHandler osrf_json_gateway_module
422     OSRFGatewayLegacyJSON "false"
423     Require all granted 
424 </Location>
425
426 # ----------------------------------------------------------------------------------
427 # OpenSRF-over-HTTP translator
428 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
429 # ----------------------------------------------------------------------------------
430
431 # OPTIONAL: Running the translator behind a proxy requires accessing
432 # the client IP address via mod_remoteip (sudo a2enmod remoteip).
433 # Below is a sample configuration for a proxy running on the same
434 # server and passing the client IP address via the X-Forwarded-For header.
435 #
436 #RemoteIPInternalProxy 127.0.0.1/24
437 #RemoteIPInternalProxy ::1
438 #RemoteIPHeader X-Forwarded-For
439
440 <Location /osrf-http-translator>
441     SetHandler osrf_http_translator_module
442     Require all granted 
443 </Location>
444
445 # ----------------------------------------------------------------------------------
446 # The exporter lives here
447 # ----------------------------------------------------------------------------------
448 <Location /exporter>
449     SetHandler perl-script
450     AuthType Basic
451     AuthName "Exporter Login"
452     PerlOptions +GlobalRequest
453     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
454     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
455     Require valid-user
456     PerlHandler OpenILS::WWW::Exporter
457     Options +ExecCGI
458     PerlSendHeader On
459 </Location>
460
461 <Location /opac/extras/merge_template>
462     SetHandler perl-script
463     AuthType Basic
464     AuthName "Batch Update Login"
465     PerlOptions +GlobalRequest
466     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
467     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
468     Require valid-user
469     PerlHandler OpenILS::WWW::TemplateBatchBibUpdate
470     PerlSendHeader On
471     Options +ExecCGI
472 </Location>
473
474 <Location /opac/extras/circ>
475     AuthType Basic
476     AuthName "Circ Extras Login"
477     PerlOptions +GlobalRequest
478     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
479     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
480     Require valid-user
481     Options +ExecCGI
482     PerlSendHeader On
483 </Location>
484
485 <Location /collections>
486     SetHandler perl-script
487     AuthType Basic
488     AuthName "Collections Login"
489     PerlOptions +GlobalRequest
490     PerlSetVar OILSProxyPermissions "money.collections_tracker.create"
491     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
492     Require valid-user
493     Options +ExecCGI
494     PerlSendHeader On
495 </Location>
496
497 # ----------------------------------------------------------------------------------
498 # Protect Standalone/Offline mode files from public view
499 # ----------------------------------------------------------------------------------
500 <Location /standalone/>
501     AuthType Basic
502     AuthName "Standalone Mode Login"
503     PerlOptions +GlobalRequest
504     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
505     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
506     Require valid-user
507     PerlSendHeader On
508     allow from all
509     SSLRequireSSL
510 </Location>
511
512 # ----------------------------------------------------------------------------------
513 # Reporting output lives here
514 # ----------------------------------------------------------------------------------
515 <Location /reporter/>
516     AuthType Basic
517     AuthName "Report Login"
518     PerlOptions +GlobalRequest
519     PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
520     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
521     Require valid-user
522     Options +ExecCGI
523     PerlSendHeader On
524 </Location>
525
526 # Currently required for access to reports when Shibboleth is enabled; may not be necessary once Angularized?
527 <IfModule mod_shib>
528     ShibCompatValidUser On
529 </IfModule>
530
531 # ----------------------------------------------------------------------------------
532 # Reports GUI
533 # ----------------------------------------------------------------------------------
534 <LocationMatch /reports.*\.x?html>
535     SSILegacyExprParser on
536     Options +Includes
537     XMLEntContentType "text/html; charset=utf-8"
538     AddOutputFilter INCLUDES;XMLENT .xhtml
539     AddOutputFilter INCLUDES;XMLENT .html
540 </LocationMatch>
541
542 <LocationMatch /reports>
543     SSILegacyExprParser on
544     Options +Includes
545     AddOutputFilter INCLUDES;XMLENT .xhtml
546 </LocationMatch>
547
548 # capture locale CGI param for /reports/fm_IDL.xml
549 RewriteCond %{REQUEST_URI} ^/reports/fm_IDL.xml
550 RewriteCond %{QUERY_STRING} locale=([^&;]*)
551 RewriteRule . - [E=locale:%1]
552
553 <LocationMatch /reports/fm_IDL.xml>
554     IDLChunkStripPI "yes"
555     IDLChunkEscapeScript "no"
556     IDLChunkStripComments "yes"
557     IDLChunkStripDoctype "yes"
558     IDLChunkContentType "application/xml; charset=utf-8"
559     AddOutputFilter INCLUDES;IDLCHUNK .xml
560     SetEnv no-gzip
561 </LocationMatch>
562
563 # ----------------------------------------------------------------------------------
564 # EDI Message viewer
565 # ----------------------------------------------------------------------------------
566 <Location /edi>
567     SetHandler perl-script
568     PerlHandler OpenILS::WWW::EDI
569     Options +ExecCGI
570     PerlSendHeader On
571     Require all granted 
572 </Location>     
573
574 # ----------------------------------------------------------------------------------
575 # XML-RPC gateway
576 # ----------------------------------------------------------------------------------
577 <Location /xml-rpc>
578     SetHandler perl-script
579     PerlHandler OpenILS::WWW::XMLRPCGateway
580     Options +ExecCGI
581     PerlSendHeader On
582     Require all granted 
583     <IfModule mod_headers.c>
584         Header onsuccess set Cache-Control no-cache
585     </IfModule>
586 </Location>
587
588 # ----------------------------------------------------------------------------------
589 # Conify - next-generation Evergreen administration interface
590 # ----------------------------------------------------------------------------------
591 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
592 <Location /conify>
593     SSILegacyExprParser on
594     Options +Includes
595     XMLEntStripPI "yes"
596     XMLEntEscapeScript "no"
597     XMLEntStripComments "no"
598     XMLEntContentType "text/html; charset=utf-8"
599     AddOutputFilter INCLUDES;XMLENT .html
600  
601     AuthType Basic
602     AuthName "Dojo Admin Login"
603     PerlOptions +GlobalRequest
604     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
605     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
606     Require valid-user
607     Options +ExecCGI
608     PerlSendHeader On
609 </Location>
610
611 # ----------------------------------------------------------------------------------
612 # The PhoneList lives here
613 # ----------------------------------------------------------------------------------
614 <Location /phonelist>
615     SetHandler perl-script
616     AuthType Basic
617     AuthName "PhoneList Login"
618     Require valid-user
619     PerlOptions +GlobalRequest
620     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
621     PerlHandler OpenILS::WWW::PhoneList
622     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
623     Options +ExecCGI
624     PerlSendHeader On
625     <IfModule mod_headers.c>
626         Header onsuccess set Cache-Control no-cache
627     </IfModule>
628 </Location>
629 <Location /vandelay-upload>
630     SetHandler perl-script
631     PerlHandler OpenILS::WWW::Vandelay::spool_marc
632     Options +ExecCGI
633     Require all granted 
634 </Location>
635 <Location /jacket-upload>
636     SetHandler perl-script
637     PerlHandler OpenILS::WWW::Vandelay::spool_jacket
638     Options +ExecCGI
639     Require all granted 
640 </Location>
641
642 # OpenURL 0.1 searching based on OpenSearch
643 RewriteMap openurl prg:@bindir@/openurl_map.pl
644 RewriteCond %{QUERY_STRING} (^.*$)
645 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
646
647
648
649 # General Evergreen web template processor
650 <Location /eg>
651     SetHandler perl-script
652     PerlHandler OpenILS::WWW::EGWeb
653     Options +ExecCGI
654     PerlSendHeader On
655     Require all granted 
656
657     PerlSetVar OILSWebBasePath "/eg"
658     PerlSetVar OILSWebWebDir "@localstatedir@/web"
659     PerlSetVar OILSWebDefaultTemplateExtension "tt2"
660
661     # Port Apache listens on for HTTP traffic.  Used for HTTP requests 
662     # routed from Perl handlers back to the same Apache instance, like
663     # added content requests.  Use this when running Apache with a 
664     # non-standard port, typical with a proxy setup.  Defaults to "80".
665     # PerlSetVar OILSWebInternalHTTPPort "7080"
666
667     # Enable Template-Toolkit error debugging messages (apache error log)
668     PerlSetVar OILSWebDebugTemplate "false"
669     # local cache of compiled Template Toolkit templates
670     PerlSetVar OILSWebCompiledTemplateCache "/tmp/eg_template_cache"
671     # template TTL - how long, in seconds, that Template Toolkit
672     # waits to check for updated template files
673     #PerlSetVar OILSWebTemplateStatTTL 60
674
675     # -------------------------------------------------------
676     # Media Prefix.  In the 3rd example, the protocol (http) is enforced
677     #PerlSetVar OILSWebMediaPrefix "/media"
678     #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
679     #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
680
681     # Locale messages files:
682     #
683     # These appear in pairs; the first represents the user agent
684     # Accept-Language header locale, and the second represents
685     # the fully-qualified path for the corresponding PO file that
686     # contains the messages.
687     #
688     # If you enable two or more locales, then users will be able to
689     # select their preferred locale from a locale picker in the Bootstrap OPAC.
690     #
691     #PerlAddVar OILSWebLocale "en"
692     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/bootstrap-opac/messages.en.po"
693     #PerlAddVar OILSWebLocale "en_ca"
694     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/bootstrap-opac/en-CA.po"
695     #PerlAddVar OILSWebLocale "fr_ca"
696     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/bootstrap-opac/fr-CA.po"
697
698     # If you're using the TPAC OPAC, you should instead set the locales
699     # like this:
700     #PerlAddVar OILSWebLocale "en"
701     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/opac/messages.en.po"
702     #PerlAddVar OILSWebLocale "en_ca"
703     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/opac/en-CA.po"
704     #PerlAddVar OILSWebLocale "fr_ca"
705     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/opac/fr-CA.po"
706
707     # Set the default locale: defaults to en-US
708     #PerlAddVar OILSWebDefaultLocale "fr_ca"
709     
710     # Templates will be loaded from the following paths in reverse order.
711     PerlAddVar OILSWebTemplatePath "@localstatedir@/templates"
712     PerlAddVar OILSWebTemplatePath "@localstatedir@/templates-bootstrap" # Comment this line out to use the legacy TPAC
713     #PerlAddVar OILSWebTemplatePath "@localstatedir@/templates_localskin"
714
715     #-------------------------------------------------
716     # Added Content Configuration
717     #-------------------------------------------------
718     # Content Cafe
719     #SetEnv OILS_CONTENT_CAFE_USER MYUSER
720     #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
721     
722     # LibraryThing
723     #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
724     #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
725     
726     # ChiliFresh
727     #SetEnv OILS_CHILIFRESH_ACCOUNT
728     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
729     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
730
731     # Novelist
732     # SetEnv OILS_NOVELIST_URL http://imageserver.ebscohost.com/novelistselect/ns2init.js
733     # SetEnv OILS_NOVELIST_PROFILE <profile>
734     # SetEnv OILS_NOVELIST_PASSWORD <password>
735
736     #-------------------------------------------------
737
738     <IfModule mod_deflate.c>
739         SetOutputFilter DEFLATE
740         BrowserMatch ^Mozilla/4 gzip-only-text/html
741         BrowserMatch ^Mozilla/4\.0[678] no-gzip
742         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
743         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
744         <IfModule mod_headers.c>
745             Header append Cache-Control "public"
746             Header append Vary User-Agent env=!dont-vary
747         </IfModule>
748     </IfModule>
749 </Location>
750 <LocationMatch ^/(images|css|js)/>
751     # should pick up the default expire time from eg.conf...
752     <IfModule mod_deflate.c>
753         SetOutputFilter DEFLATE
754         BrowserMatch ^Mozilla/4 gzip-only-text/html
755         BrowserMatch ^Mozilla/4\.0[678] no-gzip
756         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
757         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
758         <IfModule mod_headers.c>
759             Header append Cache-Control "public"
760             Header append Vary User-Agent env=!dont-vary
761         </IfModule>
762     </IfModule>
763 </LocationMatch>
764 <Location /eg/opac>
765     # Uncomment the entries below to enable Shibboleth authentication
766     #AuthType shibboleth
767     #Require shibboleth
768
769     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
770     # Expire the HTML quickly since we're loading dynamic data for each page
771     ExpiresActive On
772     ExpiresByType text/html "access plus 5 seconds"
773 </Location>
774 <Location /eg/kpac>
775     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader"
776     PerlSetVar KPacConfigFile "@sysconfdir@/kpac.xml.example"
777     ExpiresActive On
778     ExpiresByType text/html "access plus 5 seconds"
779 </Location>
780
781 # Note: the template processor will decline handling anything it does not
782 # have an explicit configuration for, which means it will fall back to 
783 # Apache to serve the file.  However, in the interest of speed, go ahead 
784 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
785 # Add more exemptions as needed.
786 <LocationMatch ^/eg/.*(\.js|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
787     SetHandler None
788 </LocationMatch>
789
790 # ----------------------------------------------------------------------------------
791 # Some mod_deflate setup
792 # ----------------------------------------------------------------------------------
793 <IfModule mod_deflate.c>
794
795     ## optional logging for mod_deflate debugging
796     ##DeflateFilterNote Input instream
797     ##DeflateFilterNote Output outstream
798     ##DeflateFilterNote Ratio ratio
799     ##
800     ##LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
801     ##CustomLog /var/log/apache2/deflate_log deflate
802
803     # There are problems with XMLENT and mod_deflate - so lets disable it
804     # This is where we don't have a pre-existing LocationMatch directive earlier
805     <LocationMatch /opac/.*\.xml$>
806         SetEnv no-gzip
807     </LocationMatch>
808     <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
809         SetEnv no-gzip
810     </LocationMatch>
811     <LocationMatch /reports/.*\.xhtml$>
812         SetEnv no-gzip
813     </LocationMatch>
814     <LocationMatch /conify/.*\.html$>
815         SetEnv no-gzip
816     </LocationMatch>
817 </IfModule>
818
819 <Location /print_template>
820     SetHandler perl-script
821     PerlHandler OpenILS::WWW::PrintTemplate
822     Options +ExecCGI
823     PerlSendHeader On
824     Require all granted 
825 </Location>
826
827
828 <Location /IDL2js>
829
830     SetHandler perl-script
831     PerlHandler OpenILS::WWW::IDL2js
832     Options +ExecCGI
833     PerlSendHeader On
834     Require all granted 
835
836     <IfModule mod_headers.c>
837         Header append Cache-Control "public"
838     </IFModule>
839
840     <IfModule mod_deflate.c>
841         SetOutputFilter DEFLATE
842         BrowserMatch ^Mozilla/4 gzip-only-text/html
843         BrowserMatch ^Mozilla/4\.0[678] no-gzip
844         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
845         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
846         <IfModule mod_headers.c>
847             Header append Vary User-Agent env=!dont-vary
848         </IfModule>
849     </IfModule>
850 </Location>
851
852 <LocationMatch /eg/staff/>
853     Options -MultiViews
854     PerlSetVar OILSWebStopAtIndex "true"
855
856     RewriteCond %{HTTPS} off
857     RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]
858
859     # sample staff-specific translation files
860     #PerlAddVar OILSWebLocale "en_ca"
861     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/staff/en-CA.po"
862     #PerlAddVar OILSWebLocale "fr_ca"
863     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/staff/fr-CA.po"
864 </LocationMatch>
865
866 <Location /js/>
867     <IfModule mod_headers.c>
868         Header append Cache-Control "public"
869     </IFModule>
870     <IfModule mod_deflate.c>
871         SetOutputFilter DEFLATE
872         BrowserMatch ^Mozilla/4 gzip-only-text/html
873         BrowserMatch ^Mozilla/4\.0[678] no-gzip
874         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
875         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
876         <IfModule mod_headers.c>
877             Header append Vary User-Agent env=!dont-vary
878         </IfModule>
879     </IfModule>
880 </Location>
881
882 <Location /api/basicauth>
883     SetHandler perl-script
884     PerlHandler OpenILS::WWW::RemoteAuth
885     Options +ExecCGI
886
887     # access restricted to localhost by default; since this module provides no
888     # client authentiation, restricting access by IP or other means is stongly
889     # recommended
890     Require local
891
892     # remoteauth profile name
893     PerlSetVar OILSRemoteAuthProfile "Basic"
894     # Perl module for processing requests
895     PerlSetVar OILSRemoteAuthHandler "OpenILS::WWW::RemoteAuth::Basic"
896
897     # staff username/password for config lookup and patron retrieval
898     PerlSetVar OILSRemoteAuthClientUsername "admin"
899     PerlSetVar OILSRemoteAuthClientPassword "demo123"
900 </Location>
901
902 <Location /api/ezproxy>
903     SetHandler perl-script
904     PerlHandler OpenILS::WWW::RemoteAuth
905     Options +ExecCGI
906
907     # access restricted to localhost by default; since this module provides no
908     # client authentiation, restricting access by IP or other means is stongly
909     # recommended
910     Require local
911
912     # remoteauth profile name
913     PerlSetVar OILSRemoteAuthProfile "EZProxyCGI"
914     # Perl module for processing requests
915     PerlSetVar OILSRemoteAuthHandler "OpenILS::WWW::RemoteAuth::EZProxyCGI"
916
917     # staff username/password for config lookup and patron retrieval
918     PerlSetVar OILSRemoteAuthClientUsername "admin"
919     PerlSetVar OILSRemoteAuthClientPassword "demo123"
920
921     # Location of TT2 templates for EZProxy login form and error pages.
922     # Templates will be loaded from the following paths in reverse order.
923     PerlAddVar OILSRemoteAuthTemplatePath "@localstatedir@/templates/remoteauth/ezproxycgi"
924     #PerlAddVar OILSRemoteAuthTemplatePath "@localstatedir@/templates_localskin/remoteauth/ezproxycgi"
925
926     # Locale (defaults to en_us)
927     #PerlAddVar OILSRemoteAuthLocale "en_us"
928
929     # Base URI of your EZProxy server; be sure there is no trailing slash
930     PerlSetVar OILSRemoteAuthEZProxyBaseURI "http://example.com/ezproxy"
931
932     # shared secret used to generate EZProxy authentication ticket
933     # This should be the same as the value in the MD5 line of your EZProxy users.txt configuration
934     # This default value is not suitable for production!
935     PerlSetVar OILSRemoteAuthEZProxySecret "secret"
936 </Location>
937
938 <Location /api/patronapi>
939     SetHandler perl-script
940     PerlHandler OpenILS::WWW::RemoteAuth
941     Options +ExecCGI
942
943     # access restricted to localhost by default; since this module provides no
944     # client authentication and can be configured to return detailed personal
945     # information, restricting access by IP or other means is stongly
946     # recommended
947     Require local
948
949     # remoteauth profile name
950     PerlSetVar OILSRemoteAuthProfile "PatronAPI"
951     # Perl module for processing requests
952     PerlSetVar OILSRemoteAuthHandler "OpenILS::WWW::RemoteAuth::PatronAPI"
953
954     # staff username/password for config lookup and patron retrieval
955     PerlSetVar OILSRemoteAuthClientUsername "admin"
956     PerlSetVar OILSRemoteAuthClientPassword "demo123"
957
958     # Location of TT2 templates for PatronAPI responses.
959     # Templates will be loaded from the following paths in reverse order.
960     PerlAddVar OILSRemoteAuthTemplatePath "@localstatedir@/templates/remoteauth/patronapi"
961     #PerlAddVar OILSRemoteAuthTemplatePath "@localstatedir@/templates_localskin/remoteauth/patronapi"
962
963     # Locale (defaults to en_us)
964     #PerlAddVar OILSRemoteAuthLocale "en_us"
965
966     # set to "true" to allow retrieval of detailed patron information
967     # without patron authorization
968     PerlSetVar OILSRemoteAuthPatronAPIAllowDump "false"
969
970     # identifier type for patron information requests (/dump)
971     # permitted values: "barcode" (default), "username"
972     #PerlSetVar OILSRemoteAuthPatronAPIIDType "barcode"
973 </Location>
974
975 # Uncomment the following to force SSL for everything. Note that this defeats caching
976 # and you will suffer a performance hit.
977 #RewriteCond %{HTTPS} off
978 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]
979
980 # ------------------------------------------------------------------------
981 # /eg2/ client setup and locale configuration.
982 #
983 # If a valid locale cookie is present that does not match the current
984 # path, redirect to the requested locale path.
985 # Otherwise, if no locale is active, redirect to the default locale.
986
987 # fr-CA
988 #RewriteCond %{REQUEST_URI} ^/eg2/
989 #RewriteCond %{REQUEST_URI} !^/eg2/fr-CA/
990 #RewriteCond %{HTTP_COOKIE} eg_locale=fr_ca
991 #RewriteRule ^/eg2/(.*) https://%{HTTP_HOST}/eg2/fr-CA/$1 [NE,R=307,L]
992
993 # Default / en-US.
994 # No alternate supported cookie provided.
995 RewriteCond %{REQUEST_URI}  ^/eg2/
996 RewriteCond %{REQUEST_URI}  !^/eg2/([a-z]{2}-[A-Z]{2})/
997 RewriteRule ^/eg2/(.*) https://%{HTTP_HOST}/eg2/en-US/$1 [NE,R=307,L]
998
999 # en-US build
1000 # This is the only required configuration when only using the default locale.
1001 <Directory "@localstatedir@/web/eg2/en-US">
1002     FallbackResource /eg2/en-US/index.html
1003     <Files "index.html">
1004       <IfModule mod_headers.c>
1005         Header set Cache-Control "no-cache, no-store, must-revalidate"
1006         Header set Pragma "no-cache"
1007         Header set Expires 0
1008       </IfModule>
1009     </Files>
1010 </Directory>
1011
1012 # fr-CA build
1013 #<Directory "@localstatedir@/web/eg2/fr-CA">
1014 #    FallbackResource /eg2/fr-CA/index.html
1015 #    <Files "index.html">
1016 #      <IfModule mod_headers.c>
1017 #        Header set Cache-Control "no-cache, no-store, must-revalidate"
1018 #        Header set Pragma "no-cache"
1019 #        Header set Expires 0
1020 #      </IfModule>
1021 #    </Files>
1022 #</Directory>