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