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