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