]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/examples/apache_24/eg_vhost.conf.in
LP1615805 No inputs after submit in patron search (AngularJS)
[working/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 # 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 # OpenSRF JSON gateway
407 # ----------------------------------------------------------------------------------
408 <Location /osrf-gateway-v1>
409     SetHandler osrf_json_gateway_module
410     Require all granted 
411 </Location>
412
413 # ----------------------------------------------------------------------------------
414 # OpenSRF-over-HTTP translator
415 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
416 # ----------------------------------------------------------------------------------
417
418 # OPTIONAL: Running the translator behind a proxy requires accessing
419 # the client IP address via mod_remoteip (sudo a2enmod remoteip).
420 # Below is a sample configuration for a proxy running on the same
421 # server and passing the client IP address via the X-Forwarded-For header.
422 #
423 #RemoteIPInternalProxy 127.0.0.1/24
424 #RemoteIPInternalProxy ::1
425 #RemoteIPHeader X-Forwarded-For
426
427 <Location /osrf-http-translator>
428     SetHandler osrf_http_translator_module
429     Require all granted 
430 </Location>
431
432 # ----------------------------------------------------------------------------------
433 # The exporter lives here
434 # ----------------------------------------------------------------------------------
435 <Location /exporter>
436     SetHandler perl-script
437     AuthType Basic
438     AuthName "Exporter Login"
439     PerlOptions +GlobalRequest
440     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
441     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
442     Require valid-user
443     PerlHandler OpenILS::WWW::Exporter
444     Options +ExecCGI
445     PerlSendHeader On
446 </Location>
447
448 <Location /opac/extras/merge_template>
449     SetHandler perl-script
450     AuthType Basic
451     AuthName "Batch Update Login"
452     PerlOptions +GlobalRequest
453     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
454     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
455     Require valid-user
456     PerlHandler OpenILS::WWW::TemplateBatchBibUpdate
457     PerlSendHeader On
458     Options +ExecCGI
459 </Location>
460
461 <Location /opac/extras/circ>
462     AuthType Basic
463     AuthName "Circ Extras Login"
464     PerlOptions +GlobalRequest
465     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
466     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
467     Require valid-user
468     Options +ExecCGI
469     PerlSendHeader On
470 </Location>
471
472 <Location /collections>
473     SetHandler perl-script
474     AuthType Basic
475     AuthName "Collections Login"
476     PerlOptions +GlobalRequest
477     PerlSetVar OILSProxyPermissions "money.collections_tracker.create"
478     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
479     Require valid-user
480     Options +ExecCGI
481     PerlSendHeader On
482 </Location>
483
484 # ----------------------------------------------------------------------------------
485 # Protect Standalone/Offline mode files from public view
486 # ----------------------------------------------------------------------------------
487 <Location /standalone/>
488     AuthType Basic
489     AuthName "Standalone Mode Login"
490     PerlOptions +GlobalRequest
491     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
492     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
493     Require valid-user
494     PerlSendHeader On
495     allow from all
496     SSLRequireSSL
497 </Location>
498
499 # ----------------------------------------------------------------------------------
500 # Reporting output lives here
501 # ----------------------------------------------------------------------------------
502 <Location /reporter/>
503     AuthType Basic
504     AuthName "Report Login"
505     PerlOptions +GlobalRequest
506     PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
507     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
508     Require valid-user
509     Options +ExecCGI
510     PerlSendHeader On
511 </Location>
512
513 # Currently required for access to reports when Shibboleth is enabled; may not be necessary once Angularized?
514 <IfModule mod_shib>
515     ShibCompatValidUser On
516 </IfModule>
517
518 # ----------------------------------------------------------------------------------
519 # Reports GUI
520 # ----------------------------------------------------------------------------------
521 <LocationMatch /reports.*\.x?html>
522     SSILegacyExprParser on
523     Options +Includes
524     XMLEntContentType "text/html; charset=utf-8"
525     AddOutputFilter INCLUDES;XMLENT .xhtml
526     AddOutputFilter INCLUDES;XMLENT .html
527 </LocationMatch>
528
529 <LocationMatch /reports>
530     SSILegacyExprParser on
531     Options +Includes
532     AddOutputFilter INCLUDES;XMLENT .xhtml
533 </LocationMatch>
534
535 # capture locale CGI param for /reports/fm_IDL.xml
536 RewriteCond %{REQUEST_URI} ^/reports/fm_IDL.xml
537 RewriteCond %{QUERY_STRING} locale=([^&;]*)
538 RewriteRule . - [E=locale:%1]
539
540 <LocationMatch /reports/fm_IDL.xml>
541     IDLChunkStripPI "yes"
542     IDLChunkEscapeScript "no"
543     IDLChunkStripComments "yes"
544     IDLChunkStripDoctype "yes"
545     IDLChunkContentType "application/xml; charset=utf-8"
546     AddOutputFilter INCLUDES;IDLCHUNK .xml
547     SetEnv no-gzip
548 </LocationMatch>
549
550 # ----------------------------------------------------------------------------------
551 # EDI Message viewer
552 # ----------------------------------------------------------------------------------
553 <Location /edi>
554     SetHandler perl-script
555     PerlHandler OpenILS::WWW::EDI
556     Options +ExecCGI
557     PerlSendHeader On
558     Require all granted 
559 </Location>     
560
561 # ----------------------------------------------------------------------------------
562 # XML-RPC gateway
563 # ----------------------------------------------------------------------------------
564 <Location /xml-rpc>
565     SetHandler perl-script
566     PerlHandler OpenILS::WWW::XMLRPCGateway
567     Options +ExecCGI
568     PerlSendHeader On
569     Require all granted 
570     <IfModule mod_headers.c>
571         Header onsuccess set Cache-Control no-cache
572     </IfModule>
573 </Location>
574
575 # ----------------------------------------------------------------------------------
576 # Conify - next-generation Evergreen administration interface
577 # ----------------------------------------------------------------------------------
578 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
579 <Location /conify>
580     SSILegacyExprParser on
581     Options +Includes
582     XMLEntStripPI "yes"
583     XMLEntEscapeScript "no"
584     XMLEntStripComments "no"
585     XMLEntContentType "text/html; charset=utf-8"
586     AddOutputFilter INCLUDES;XMLENT .html
587  
588     AuthType Basic
589     AuthName "Dojo Admin Login"
590     PerlOptions +GlobalRequest
591     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
592     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
593     Require valid-user
594     Options +ExecCGI
595     PerlSendHeader On
596 </Location>
597
598 # ----------------------------------------------------------------------------------
599 # The PhoneList lives here
600 # ----------------------------------------------------------------------------------
601 <Location /phonelist>
602     SetHandler perl-script
603     AuthType Basic
604     AuthName "PhoneList Login"
605     Require valid-user
606     PerlOptions +GlobalRequest
607     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
608     PerlHandler OpenILS::WWW::PhoneList
609     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
610     Options +ExecCGI
611     PerlSendHeader On
612     <IfModule mod_headers.c>
613         Header onsuccess set Cache-Control no-cache
614     </IfModule>
615 </Location>
616 <Location /vandelay-upload>
617     SetHandler perl-script
618     PerlHandler OpenILS::WWW::Vandelay::spool_marc
619     Options +ExecCGI
620     Require all granted 
621 </Location>
622 <Location /jacket-upload>
623     SetHandler perl-script
624     PerlHandler OpenILS::WWW::Vandelay::spool_jacket
625     Options +ExecCGI
626     Require all granted 
627 </Location>
628
629 # OpenURL 0.1 searching based on OpenSearch
630 RewriteMap openurl prg:@bindir@/openurl_map.pl
631 RewriteCond %{QUERY_STRING} (^.*$)
632 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
633
634
635
636 # General Evergreen web template processor
637 <Location /eg>
638     SetHandler perl-script
639     PerlHandler OpenILS::WWW::EGWeb
640     Options +ExecCGI
641     PerlSendHeader On
642     Require all granted 
643
644     PerlSetVar OILSWebBasePath "/eg"
645     PerlSetVar OILSWebWebDir "@localstatedir@/web"
646     PerlSetVar OILSWebDefaultTemplateExtension "tt2"
647
648     # Port Apache listens on for HTTP traffic.  Used for HTTP requests 
649     # routed from Perl handlers back to the same Apache instance, like
650     # added content requests.  Use this when running Apache with a 
651     # non-standard port, typical with a proxy setup.  Defaults to "80".
652     # PerlSetVar OILSWebInternalHTTPPort "7080"
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 Bootstrap OPAC.
677     #
678     #PerlAddVar OILSWebLocale "en"
679     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/bootstrap-opac/messages.en.po"
680     #PerlAddVar OILSWebLocale "en_ca"
681     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/bootstrap-opac/en-CA.po"
682     #PerlAddVar OILSWebLocale "fr_ca"
683     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/bootstrap-opac/fr-CA.po"
684
685     # If you're using the TPAC OPAC, you should instead set the locales
686     # like this:
687     #PerlAddVar OILSWebLocale "en"
688     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/opac/messages.en.po"
689     #PerlAddVar OILSWebLocale "en_ca"
690     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/opac/en-CA.po"
691     #PerlAddVar OILSWebLocale "fr_ca"
692     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/opac/fr-CA.po"
693
694     # Set the default locale: defaults to en-US
695     #PerlAddVar OILSWebDefaultLocale "fr_ca"
696     
697     # Templates will be loaded from the following paths in reverse order.
698     PerlAddVar OILSWebTemplatePath "@localstatedir@/templates"
699     PerlAddVar OILSWebTemplatePath "@localstatedir@/templates-bootstrap" # Comment this line out to use the legacy TPAC
700     #PerlAddVar OILSWebTemplatePath "@localstatedir@/templates_localskin"
701
702     #-------------------------------------------------
703     # Added Content Configuration
704     #-------------------------------------------------
705     # Content Cafe
706     #SetEnv OILS_CONTENT_CAFE_USER MYUSER
707     #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
708     
709     # LibraryThing
710     #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
711     #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
712     
713     # ChiliFresh
714     #SetEnv OILS_CHILIFRESH_ACCOUNT
715     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
716     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
717
718     # Novelist
719     # SetEnv OILS_NOVELIST_URL http://imageserver.ebscohost.com/novelistselect/ns2init.js
720     # SetEnv OILS_NOVELIST_PROFILE <profile>
721     # SetEnv OILS_NOVELIST_PASSWORD <password>
722
723     #-------------------------------------------------
724
725     <IfModule mod_deflate.c>
726         SetOutputFilter DEFLATE
727         BrowserMatch ^Mozilla/4 gzip-only-text/html
728         BrowserMatch ^Mozilla/4\.0[678] no-gzip
729         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
730         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
731         <IfModule mod_headers.c>
732             Header append Cache-Control "public"
733             Header append Vary User-Agent env=!dont-vary
734         </IfModule>
735     </IfModule>
736 </Location>
737 <LocationMatch ^/(images|css|js)/>
738     # should pick up the default expire time from eg.conf...
739     <IfModule mod_deflate.c>
740         SetOutputFilter DEFLATE
741         BrowserMatch ^Mozilla/4 gzip-only-text/html
742         BrowserMatch ^Mozilla/4\.0[678] no-gzip
743         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
744         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
745         <IfModule mod_headers.c>
746             Header append Cache-Control "public"
747             Header append Vary User-Agent env=!dont-vary
748         </IfModule>
749     </IfModule>
750 </LocationMatch>
751 <Location /eg/opac>
752     # Uncomment the entries below to enable Shibboleth authentication
753     #AuthType shibboleth
754     #Require shibboleth
755
756     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
757     # Expire the HTML quickly since we're loading dynamic data for each page
758     ExpiresActive On
759     ExpiresByType text/html "access plus 5 seconds"
760 </Location>
761 <Location /eg/kpac>
762     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader"
763     PerlSetVar KPacConfigFile "@sysconfdir@/kpac.xml.example"
764     ExpiresActive On
765     ExpiresByType text/html "access plus 5 seconds"
766 </Location>
767
768 # Note: the template processor will decline handling anything it does not
769 # have an explicit configuration for, which means it will fall back to 
770 # Apache to serve the file.  However, in the interest of speed, go ahead 
771 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
772 # Add more exemptions as needed.
773 <LocationMatch ^/eg/.*(\.js|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
774     SetHandler None
775 </LocationMatch>
776
777 # ----------------------------------------------------------------------------------
778 # Some mod_deflate setup
779 # ----------------------------------------------------------------------------------
780 <IfModule mod_deflate.c>
781
782     ## optional logging for mod_deflate debugging
783     ##DeflateFilterNote Input instream
784     ##DeflateFilterNote Output outstream
785     ##DeflateFilterNote Ratio ratio
786     ##
787     ##LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
788     ##CustomLog /var/log/apache2/deflate_log deflate
789
790     # There are problems with XMLENT and mod_deflate - so lets disable it
791     # This is where we don't have a pre-existing LocationMatch directive earlier
792     <LocationMatch /opac/.*\.xml$>
793         SetEnv no-gzip
794     </LocationMatch>
795     <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
796         SetEnv no-gzip
797     </LocationMatch>
798     <LocationMatch /reports/.*\.xhtml$>
799         SetEnv no-gzip
800     </LocationMatch>
801     <LocationMatch /conify/.*\.html$>
802         SetEnv no-gzip
803     </LocationMatch>
804 </IfModule>
805
806 <Location /print_template>
807     SetHandler perl-script
808     PerlHandler OpenILS::WWW::PrintTemplate
809     Options +ExecCGI
810     PerlSendHeader On
811     Require all granted 
812 </Location>
813
814
815 <Location /IDL2js>
816
817     SetHandler perl-script
818     PerlHandler OpenILS::WWW::IDL2js
819     Options +ExecCGI
820     PerlSendHeader On
821     Require all granted 
822
823     <IfModule mod_headers.c>
824         Header append Cache-Control "public"
825     </IFModule>
826
827     <IfModule mod_deflate.c>
828         SetOutputFilter DEFLATE
829         BrowserMatch ^Mozilla/4 gzip-only-text/html
830         BrowserMatch ^Mozilla/4\.0[678] no-gzip
831         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
832         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
833         <IfModule mod_headers.c>
834             Header append Vary User-Agent env=!dont-vary
835         </IfModule>
836     </IfModule>
837 </Location>
838
839 <LocationMatch /eg/staff/>
840     Options -MultiViews
841     PerlSetVar OILSWebStopAtIndex "true"
842
843     RewriteCond %{HTTPS} off
844     RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]
845
846     # sample staff-specific translation files
847     #PerlAddVar OILSWebLocale "en_ca"
848     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/staff/en-CA.po"
849     #PerlAddVar OILSWebLocale "fr_ca"
850     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/staff/fr-CA.po"
851 </LocationMatch>
852
853 <Location /js/>
854     <IfModule mod_headers.c>
855         Header append Cache-Control "public"
856     </IFModule>
857     <IfModule mod_deflate.c>
858         SetOutputFilter DEFLATE
859         BrowserMatch ^Mozilla/4 gzip-only-text/html
860         BrowserMatch ^Mozilla/4\.0[678] no-gzip
861         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
862         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
863         <IfModule mod_headers.c>
864             Header append Vary User-Agent env=!dont-vary
865         </IfModule>
866     </IfModule>
867 </Location>
868
869 <Location /api/basicauth>
870     SetHandler perl-script
871     PerlHandler OpenILS::WWW::RemoteAuth
872     Options +ExecCGI
873
874     # access restricted to localhost by default; since this module provides no
875     # client authentiation, restricting access by IP or other means is stongly
876     # recommended
877     Require local
878
879     # remoteauth profile name
880     PerlSetVar OILSRemoteAuthProfile "Basic"
881     # Perl module for processing requests
882     PerlSetVar OILSRemoteAuthHandler "OpenILS::WWW::RemoteAuth::Basic"
883
884     # staff username/password for config lookup and patron retrieval
885     PerlSetVar OILSRemoteAuthClientUsername "admin"
886     PerlSetVar OILSRemoteAuthClientPassword "demo123"
887 </Location>
888
889 <Location /api/ezproxy>
890     SetHandler perl-script
891     PerlHandler OpenILS::WWW::RemoteAuth
892     Options +ExecCGI
893
894     # access restricted to localhost by default; since this module provides no
895     # client authentiation, restricting access by IP or other means is stongly
896     # recommended
897     Require local
898
899     # remoteauth profile name
900     PerlSetVar OILSRemoteAuthProfile "EZProxyCGI"
901     # Perl module for processing requests
902     PerlSetVar OILSRemoteAuthHandler "OpenILS::WWW::RemoteAuth::EZProxyCGI"
903
904     # staff username/password for config lookup and patron retrieval
905     PerlSetVar OILSRemoteAuthClientUsername "admin"
906     PerlSetVar OILSRemoteAuthClientPassword "demo123"
907
908     # Location of TT2 templates for EZProxy login form and error pages.
909     # Templates will be loaded from the following paths in reverse order.
910     PerlAddVar OILSRemoteAuthTemplatePath "@localstatedir@/templates/remoteauth/ezproxycgi"
911     #PerlAddVar OILSRemoteAuthTemplatePath "@localstatedir@/templates_localskin/remoteauth/ezproxycgi"
912
913     # Locale (defaults to en_us)
914     #PerlAddVar OILSRemoteAuthLocale "en_us"
915
916     # Base URI of your EZProxy server; be sure there is no trailing slash
917     PerlSetVar OILSRemoteAuthEZProxyBaseURI "http://example.com/ezproxy"
918
919     # shared secret used to generate EZProxy authentication ticket
920     # This should be the same as the value in the MD5 line of your EZProxy users.txt configuration
921     # This default value is not suitable for production!
922     PerlSetVar OILSRemoteAuthEZProxySecret "secret"
923 </Location>
924
925 <Location /api/patronapi>
926     SetHandler perl-script
927     PerlHandler OpenILS::WWW::RemoteAuth
928     Options +ExecCGI
929
930     # access restricted to localhost by default; since this module provides no
931     # client authentication and can be configured to return detailed personal
932     # information, restricting access by IP or other means is stongly
933     # recommended
934     Require local
935
936     # remoteauth profile name
937     PerlSetVar OILSRemoteAuthProfile "PatronAPI"
938     # Perl module for processing requests
939     PerlSetVar OILSRemoteAuthHandler "OpenILS::WWW::RemoteAuth::PatronAPI"
940
941     # staff username/password for config lookup and patron retrieval
942     PerlSetVar OILSRemoteAuthClientUsername "admin"
943     PerlSetVar OILSRemoteAuthClientPassword "demo123"
944
945     # Location of TT2 templates for PatronAPI responses.
946     # Templates will be loaded from the following paths in reverse order.
947     PerlAddVar OILSRemoteAuthTemplatePath "@localstatedir@/templates/remoteauth/patronapi"
948     #PerlAddVar OILSRemoteAuthTemplatePath "@localstatedir@/templates_localskin/remoteauth/patronapi"
949
950     # Locale (defaults to en_us)
951     #PerlAddVar OILSRemoteAuthLocale "en_us"
952
953     # set to "true" to allow retrieval of detailed patron information
954     # without patron authorization
955     PerlSetVar OILSRemoteAuthPatronAPIAllowDump "false"
956
957     # identifier type for patron information requests (/dump)
958     # permitted values: "barcode" (default), "username"
959     #PerlSetVar OILSRemoteAuthPatronAPIIDType "barcode"
960 </Location>
961
962 # Uncomment the following to force SSL for everything. Note that this defeats caching
963 # and you will suffer a performance hit.
964 #RewriteCond %{HTTPS} off
965 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]
966
967 # ------------------------------------------------------------------------
968 # /eg2/ client setup and locale configuration.
969 #
970 # If a valid locale cookie is present that does not match the current
971 # path, redirect to the requested locale path.
972 # Otherwise, if no locale is active, redirect to the default locale.
973
974 # fr-CA
975 #RewriteCond %{REQUEST_URI} ^/eg2/
976 #RewriteCond %{REQUEST_URI} !^/eg2/fr-CA/
977 #RewriteCond %{HTTP_COOKIE} eg_locale=fr_ca
978 #RewriteRule ^/eg2/(.*) https://%{HTTP_HOST}/eg2/fr-CA/$1 [NE,R=307,L]
979
980 # Default / en-US.
981 # No alternate supported cookie provided.
982 RewriteCond %{REQUEST_URI}  ^/eg2/
983 RewriteCond %{REQUEST_URI}  !^/eg2/([a-z]{2}-[A-Z]{2})/
984 RewriteRule ^/eg2/(.*) https://%{HTTP_HOST}/eg2/en-US/$1 [NE,R=307,L]
985
986 # en-US build
987 # This is the only required configuration when only using the default locale.
988 <Directory "@localstatedir@/web/eg2/en-US">
989     FallbackResource /eg2/en-US/index.html
990     <Files "index.html">
991       <IfModule mod_headers.c>
992         Header set Cache-Control "no-cache, no-store, must-revalidate"
993         Header set Pragma "no-cache"
994         Header set Expires 0
995       </IfModule>
996     </Files>
997 </Directory>
998
999 # fr-CA build
1000 #<Directory "@localstatedir@/web/eg2/fr-CA">
1001 #    FallbackResource /eg2/fr-CA/index.html
1002 #    <Files "index.html">
1003 #      <IfModule mod_headers.c>
1004 #        Header set Cache-Control "no-cache, no-store, must-revalidate"
1005 #        Header set Pragma "no-cache"
1006 #        Header set Expires 0
1007 #      </IfModule>
1008 #    </Files>
1009 #</Directory>