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