]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/examples/apache/eg_vhost.conf.in
LP#1347807: Add example "No Image" configuration
[working/Evergreen.git] / Open-ILS / examples / apache / 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     allow from all
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     Allow from All
61 </Location>
62
63 # Flattener service
64 <Location /opac/extras/flattener>
65     SetHandler perl-script
66     PerlHandler OpenILS::WWW::FlatFielder
67     PerlSendHeader On
68     Allow from All
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     AddType application/xhtml+xml .xml
172    
173     # - configure mod_xmlent
174     XMLEntStripPI "yes"
175     XMLEntEscapeScript "no"
176     XMLEntStripComments "yes"
177     XMLEntContentType "text/html; charset=utf-8"
178     # forces quirks mode which we want for now
179     XMLEntStripDoctype "yes" 
180
181     # - set up the include handlers
182     Options +Includes
183     AddOutputFilter INCLUDES .xsl
184     AddOutputFilter INCLUDES;XMLENT .xml
185                     
186     SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
187     
188     # This gives you the option to configure a different host to serve OPAC images from
189     # Specify the hostname (without protocol) and path to the images.  Protocol will
190     # be determined at runtime
191     #SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=static.example.org/opac/
192
193     # In addition to loading images from a static host, you can also load CSS and/or
194     # Javascript from a static host or hosts. Protocol will be determined at runtime
195     # and/or by configuration options immediately following.
196     #SetEnvIf Request_URI ".*" OILS_OPAC_CSS_HOST=static.example.org/opac/
197     #SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=static.example.org/opac/
198
199     # If you are not able to serve static content via https and 
200     # wish to force http:// (and are comfortable with mixed-content
201     # warnings in client browsers), set this:
202     #SetEnvIf Request_URI ".*" OILS_OPAC_STATIC_PROTOCOL=http
203
204     # If you would prefer to fall back to your non-static servers for 
205     # https pages, avoiding mixed-content warnings in client browsers
206     # and are willing to accept some increased server load, set this:
207     #SetEnvIf Request_URI ".*" OILS_OPAC_BYPASS_STATIC_FOR_HTTPS=yes
208
209     # Specify a ChiliFresh account to integrate their services with the OPAC
210     #SetEnv OILS_CHILIFRESH_ACCOUNT
211     #SetEnv OILS_CHILIFRESH_PROFILE
212     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
213     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
214
215     # Specify the initial script URL for Novelist (containing account credentials, etc.)
216     #SetEnv OILS_NOVELIST_URL
217     #
218
219     # Uncomment to force SSL any time a patron is logged in.  This protects 
220     # authentication tokens.  Left commented out for backwards compat for now.
221     #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
222
223     # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js
224     #SetEnv OILS_OPAC_COMBINED_JS 1
225
226 </LocationMatch>
227
228 <Location /opac/>
229     # ----------------------------------------------------------------------------------
230     # Some mod_deflate fun
231     # ----------------------------------------------------------------------------------
232     <IfModule mod_deflate.c>
233         SetOutputFilter DEFLATE
234
235         BrowserMatch ^Mozilla/4 gzip-only-text/html
236         BrowserMatch ^Mozilla/4\.0[678] no-gzip
237         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
238
239         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
240
241         <IfModule mod_headers.c>
242             Header append Vary User-Agent env=!dont-vary
243         </IfModule>
244     </IfModule>
245
246 </Location>
247
248 <Location //opac/>
249     # ----------------------------------------------------------------------------------
250     # Some mod_deflate fun
251     # ----------------------------------------------------------------------------------
252     <IfModule mod_deflate.c>
253         SetOutputFilter DEFLATE
254
255         BrowserMatch ^Mozilla/4 gzip-only-text/html
256         BrowserMatch ^Mozilla/4\.0[678] no-gzip
257         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
258
259         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
260
261         <IfModule mod_headers.c>
262             Header append Vary User-Agent env=!dont-vary
263         </IfModule>
264     </IfModule>
265
266 </Location>
267
268 # ----------------------------------------------------------------------------------
269 # Force SSL on the OPAC's "My Account" page
270 # ----------------------------------------------------------------------------------
271 <LocationMatch .*/myopac.xml>
272     SSLRequireSSL
273 </LocationMatch>
274
275 <LocationMatch /opac/extras/>
276     # Force to en-US for now to satisfy bbags.xml
277     SetEnv locale en-US
278     Options +Includes
279     AddOutputFilter INCLUDES .xml
280     AddType application/xhtml+xml .xml
281 </LocationMatch>
282
283 RewriteCond %{QUERY_STRING} locale=([^&]*)
284 RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
285 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
286     AddOutputFilter INCLUDES;XMLENT .html
287 </LocationMatch>
288
289 # ----------------------------------------------------------------------------------
290 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
291 # ----------------------------------------------------------------------------------
292 RewriteCond %{HTTP:Accept-Language} ^([a-z]{2}-[A-Z]{2})$
293 # Default to en-US if we haven't matched a locale of the form xx-YY 
294 RewriteRule .? - [S=4]
295 RewriteRule ^/xul/      -       [E=locale:en-US]
296 RewriteRule ^/reports/  -       [E=locale:en-US]
297 RewriteRule .? - [E=locale:en-US]
298 RewriteRule .? - [S=3]
299 # Otherwise, set our real locale
300 RewriteRule ^/xul/      -       [E=locale:%{HTTP:Accept-Language}]
301 RewriteRule ^/reports/  -       [E=locale:%{HTTP:Accept-Language}]
302 RewriteRule .? - [E=locale:%{HTTP:Accept-Language}]
303
304 <LocationMatch /xul/.*\.x?html$>
305     Options +Includes
306     XMLEntEscapeScript "no"
307     XMLEntStripComments "yes"
308     XMLEntStripPI "yes"
309     XMLEntStripDoctype "yes"
310     XMLEntContentType "text/html; charset=utf-8"
311     AddOutputFilter INCLUDES;XMLENT .xhtml
312     AddOutputFilter INCLUDES;XMLENT .html
313     SetEnv no-gzip
314     allow from all
315 </LocationMatch>
316
317
318 <LocationMatch /xul/.*\.xul$>
319     Options +Includes
320     XMLEntContentType "application/vnd.mozilla.xul+xml"
321     AddOutputFilter INCLUDES;XMLENT .xul
322     SetEnv no-gzip
323     allow from all
324 </LocationMatch>
325
326 # ----------------------------------------------------------------------------------
327 # Supercat feeds
328 # ----------------------------------------------------------------------------------
329 <Location /opac/extras/oisbn>
330     SetHandler perl-script
331     PerlHandler OpenILS::WWW::SuperCat::oisbn
332     Options +ExecCGI
333     PerlSendHeader On
334     allow from all
335 </Location>
336 <Location /opac/extras/supercat>
337     SetHandler perl-script
338     PerlHandler OpenILS::WWW::SuperCat::supercat
339     Options +ExecCGI
340     PerlSendHeader On
341     allow from all
342 </Location>
343 <Location /opac/extras/unapi>
344     SetHandler perl-script
345     PerlHandler OpenILS::WWW::SuperCat::unapi
346     Options +ExecCGI
347     PerlSendHeader On
348     allow from all
349 </Location>
350 <Location /opac/extras/feed/bookbag>
351     SetHandler perl-script
352     PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
353     Options +ExecCGI
354     PerlSendHeader On
355     allow from all
356 </Location>
357 <Location /opac/extras/opensearch>
358     SetHandler perl-script
359     PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
360     Options +ExecCGI
361     PerlSendHeader On
362     allow from all
363 </Location>
364 <Location /opac/extras/sru>
365     SetHandler perl-script
366     PerlHandler OpenILS::WWW::SuperCat::sru_search
367     Options +ExecCGI
368     PerlSendHeader On
369     allow from all
370 </Location>
371 <Location /opac/extras/sru_auth>
372     SetHandler perl-script
373     PerlHandler OpenILS::WWW::SuperCat::sru_auth_search
374     Options +ExecCGI
375     PerlSendHeader On
376     allow from all
377 </Location>
378 <Location /opac/extras/feed/freshmeat>
379     SetHandler perl-script
380     PerlHandler OpenILS::WWW::SuperCat::changes_feed
381     Options +ExecCGI
382     PerlSendHeader On
383     allow from all
384 </Location>
385 <Location /opac/extras/browse>
386     SetHandler perl-script
387     PerlHandler OpenILS::WWW::SuperCat::string_browse
388     Options +ExecCGI
389     PerlSendHeader On
390     allow from all
391 </Location>     
392 <Location /opac/extras/startwith>
393     SetHandler perl-script
394     PerlHandler OpenILS::WWW::SuperCat::string_startwith
395     Options +ExecCGI
396     PerlSendHeader On
397     allow from all
398 </Location>     
399         
400 # ----------------------------------------------------------------------------------
401 # Module for displaying OpenSRF API documentation
402 # ----------------------------------------------------------------------------------
403 <Location /opac/extras/docgen.xsl>
404     AddOutputFilter INCLUDES .xsl
405 </Location>
406
407 # ----------------------------------------------------------------------------------
408 # Module for processing staff-client offline scripts lives here
409 # ----------------------------------------------------------------------------------
410 <Directory "@localstatedir@/cgi-bin/offline">
411     AddHandler cgi-script .pl
412     AllowOverride None
413     Options +ExecCGI
414     allow from all
415 </Directory>
416         
417         
418 # ----------------------------------------------------------------------------------
419 # XXX Note, it's important to explicitly set the JSON encoding style 
420 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change 
421 # with OpenSRF 1.0
422 # ----------------------------------------------------------------------------------
423 # OpenSRF JSON legacy gateway
424 # ----------------------------------------------------------------------------------
425 <Location /gateway>
426     SetHandler osrf_json_gateway_module
427     OSRFGatewayLegacyJSON "true"
428     allow from all
429 </Location>
430 # ----------------------------------------------------------------------------------
431 # New-style OpenSRF JSON gateway
432 # ----------------------------------------------------------------------------------
433 <Location /osrf-gateway-v1>
434     SetHandler osrf_json_gateway_module
435     OSRFGatewayLegacyJSON "false"
436     allow from all
437 </Location>
438
439 # ----------------------------------------------------------------------------------
440 # OpenSRF-over-HTTP translator
441 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
442 # ----------------------------------------------------------------------------------
443 <Location /osrf-http-translator>
444     SetHandler osrf_http_translator_module
445     allow from all
446 </Location>
447
448 # ----------------------------------------------------------------------------------
449 # The exporter lives here
450 # ----------------------------------------------------------------------------------
451 <Location /exporter>
452     SetHandler perl-script
453     AuthType Basic
454     AuthName "Exporter Login"
455     PerlOptions +GlobalRequest
456     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
457     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
458     require valid-user
459     PerlHandler OpenILS::WWW::Exporter
460     Options +ExecCGI
461     PerlSendHeader On
462     allow from all
463 </Location>
464
465 <Location /opac/extras/merge_template>
466     SetHandler perl-script
467     AuthType Basic
468     AuthName "Batch Update Login"
469     PerlOptions +GlobalRequest
470     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
471     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
472     require valid-user
473     PerlHandler OpenILS::WWW::TemplateBatchBibUpdate
474     PerlSendHeader On
475     Options +ExecCGI
476     allow from all
477 </Location>
478
479 <Location /opac/extras/circ>
480     AuthType Basic
481     AuthName "Circ Extras Login"
482     PerlOptions +GlobalRequest
483     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
484     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
485     require valid-user
486     Options +ExecCGI
487     PerlSendHeader On
488     allow from all
489 </Location>
490
491 <Location /collections>
492     SetHandler perl-script
493     AuthType Basic
494     AuthName "Collections Login"
495     PerlOptions +GlobalRequest
496     PerlSetVar OILSProxyPermissions "money.collections_tracker.create"
497     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
498     require valid-user
499     Options +ExecCGI
500     PerlSendHeader On
501     allow from all
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     allow from all
532 </Location>
533
534 # ----------------------------------------------------------------------------------
535 # Selfcheck interface
536 # ----------------------------------------------------------------------------------
537 <LocationMatch .*/selfcheck.xml>
538     AuthType Basic
539     AuthName "Self-check Login"
540     PerlOptions +GlobalRequest
541     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
542     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
543     require valid-user
544     Options +ExecCGI
545     PerlSendHeader On
546     allow from all
547 </LocationMatch>
548
549
550 # ----------------------------------------------------------------------------------
551 # Reports GUI
552 # ----------------------------------------------------------------------------------
553 <LocationMatch /reports>
554     Options +Includes
555     AddOutputFilter INCLUDES;XMLENT .xhtml
556 </LocationMatch>
557
558 # capture locale CGI param for /reports/fm_IDL.xml
559 RewriteCond %{REQUEST_URI} ^/reports/fm_IDL.xml
560 RewriteCond %{QUERY_STRING} locale=([^&;]*)
561 RewriteRule . - [E=locale:%1]
562
563 <LocationMatch /reports/fm_IDL.xml>
564     IDLChunkStripPI "yes"
565     IDLChunkEscapeScript "no"
566     IDLChunkStripComments "yes"
567     IDLChunkStripDoctype "yes"
568     IDLChunkContentType "application/xml; charset=utf-8"
569     AddOutputFilter INCLUDES;IDLCHUNK .xml
570     SetEnv no-gzip
571 </LocationMatch>
572
573 # ----------------------------------------------------------------------------------
574 # EDI Message viewer
575 # ----------------------------------------------------------------------------------
576 <Location /edi>
577     SetHandler perl-script
578     PerlHandler OpenILS::WWW::EDI
579     Options +ExecCGI
580     PerlSendHeader On
581     allow from all
582 </Location>     
583
584 # ----------------------------------------------------------------------------------
585 # XML-RPC gateway
586 # ----------------------------------------------------------------------------------
587 <Location /xml-rpc>
588     SetHandler perl-script
589     PerlHandler OpenILS::WWW::XMLRPCGateway
590     Options +ExecCGI
591     PerlSendHeader On
592     allow from all
593     <IfModule mod_headers.c>
594         Header onsuccess set Cache-Control no-cache
595     </IfModule>
596 </Location>
597
598 # ----------------------------------------------------------------------------------
599 # Conify - next-generation Evergreen administration interface
600 # ----------------------------------------------------------------------------------
601 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
602 <Location /conify>
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     allow from all
619 </Location>
620
621 # ----------------------------------------------------------------------------------
622 # The PhoneList lives here
623 # ----------------------------------------------------------------------------------
624 <Location /phonelist>
625     SetHandler perl-script
626     AuthType Basic
627     AuthName "PhoneList Login"
628     require valid-user
629     PerlOptions +GlobalRequest
630     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
631     PerlHandler OpenILS::WWW::PhoneList
632     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
633     Options +ExecCGI
634     PerlSendHeader On
635     allow from all
636     <IfModule mod_headers.c>
637         Header onsuccess set Cache-Control no-cache
638     </IfModule>
639 </Location>
640 <Location /vandelay-upload>
641     SetHandler perl-script
642     PerlHandler OpenILS::WWW::Vandelay::spool_marc
643     Options +ExecCGI
644     allow from all
645 </Location>
646
647 # OpenURL 0.1 searching based on OpenSearch
648 RewriteMap openurl prg:@bindir@/openurl_map.pl
649 RewriteCond %{QUERY_STRING} (^.*$)
650 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
651
652
653
654 # General Evergreen web template processor
655 <Location /eg>
656     SetHandler perl-script
657     PerlHandler OpenILS::WWW::EGWeb
658     Options +ExecCGI
659     PerlSendHeader On
660     allow from all
661
662     PerlSetVar OILSWebBasePath "/eg"
663     PerlSetVar OILSWebWebDir "@localstatedir@/web"
664     PerlSetVar OILSWebDefaultTemplateExtension "tt2"
665
666     # Enable Template-Toolkit error debugging messages (apache error log)
667     PerlSetVar OILSWebDebugTemplate "false"
668     # local cache of compiled Template Toolkit templates
669     PerlSetVar OILSWebCompiledTemplateCache "/tmp/eg_template_cache"
670     # template TTL - how long, in seconds, that Template Toolkit
671     # waits to check for updated template files
672     #PerlSetVar OILSWebTemplateStatTTL 60
673
674     # -------------------------------------------------------
675     # Media Prefix.  In the 3rd example, the protocol (http) is enforced
676     #PerlSetVar OILSWebMediaPrefix "/media"
677     #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
678     #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
679
680     # Locale messages files:
681     #
682     # These appear in pairs; the first represents the user agent
683     # Accept-Language header locale, and the second represents
684     # the fully-qualified path for the corresponding PO file that
685     # contains the messages.
686     #
687     # If you enable two or more locales, then users will be able to
688     # select their preferred locale from a locale picker in the TPAC.
689     #
690     #PerlAddVar OILSWebLocale "en"
691     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/messages.en.po"
692     #PerlAddVar OILSWebLocale "en_ca"
693     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/en-CA.po"
694     #PerlAddVar OILSWebLocale "fr_ca"
695     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/fr-CA.po"
696
697     # Set the default locale: defaults to en-US
698     #PerlAddVar OILSWebDefaultLocale "fr_ca"
699     
700     # Templates will be loaded from the following paths in reverse order.
701     PerlAddVar OILSWebTemplatePath "@localstatedir@/templates"
702     #PerlAddVar OILSWebTemplatePath "@localstatedir@/templates_localskin"
703
704     #-------------------------------------------------
705     # Added Content Configuration
706     #-------------------------------------------------
707     # Content Cafe
708     #SetEnv OILS_CONTENT_CAFE_USER MYUSER
709     #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
710     
711     # LibraryThing
712     #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
713     #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
714     
715     # ChiliFresh
716     #SetEnv OILS_CHILIFRESH_ACCOUNT
717     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
718     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
719     #-------------------------------------------------
720
721     <IfModule mod_deflate.c>
722         SetOutputFilter DEFLATE
723         BrowserMatch ^Mozilla/4 gzip-only-text/html
724         BrowserMatch ^Mozilla/4\.0[678] no-gzip
725         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
726         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
727         <IfModule mod_headers.c>
728             Header append Cache-Control "public"
729             Header append Vary User-Agent env=!dont-vary
730         </IfModule>
731     </IfModule>
732 </Location>
733 <LocationMatch ^/(images|css|js)/>
734     # should pick up the default expire time from eg.conf...
735     <IfModule mod_deflate.c>
736         SetOutputFilter DEFLATE
737         BrowserMatch ^Mozilla/4 gzip-only-text/html
738         BrowserMatch ^Mozilla/4\.0[678] no-gzip
739         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
740         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
741         <IfModule mod_headers.c>
742             Header append Cache-Control "public"
743             Header append Vary User-Agent env=!dont-vary
744         </IfModule>
745     </IfModule>
746 </LocationMatch>
747 <Location /eg/opac>
748     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
749     # Expire the HTML quickly since we're loading dynamic data for each page
750     ExpiresActive On
751     ExpiresByType text/html "access plus 5 seconds"
752 </Location>
753 <Location /eg/kpac>
754     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader"
755     PerlSetVar KPacConfigFile "@sysconfdir@/kpac.xml.example"
756     ExpiresActive On
757     ExpiresByType text/html "access plus 5 seconds"
758 </Location>
759
760 # Note: the template processor will decline handling anything it does not
761 # have an explicit configuration for, which means it will fall back to 
762 # Apache to serve the file.  However, in the interest of speed, go ahead 
763 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
764 # Add more exemptions as needed.
765 <LocationMatch ^/eg/.*(\.js|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
766     SetHandler None
767 </LocationMatch>
768
769 # ----------------------------------------------------------------------------------
770 # Some mod_deflate setup
771 # ----------------------------------------------------------------------------------
772 <IfModule mod_deflate.c>
773     ## optional logging for mod_deflate debugging
774     ##DeflateFilterNote Input instream
775     ##DeflateFilterNote Output outstream
776     ##DeflateFilterNote Ratio ratio
777     ##
778     ##LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
779     ##CustomLog /var/log/apache2/deflate_log deflate
780
781     # There are problems with XMLENT and mod_deflate - so lets disable it
782     # This is where we don't have a pre-existing LocationMatch directive earlier
783     <LocationMatch /opac/.*\.xml$>
784         SetEnv no-gzip
785     </LocationMatch>
786     <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
787         SetEnv no-gzip
788     </LocationMatch>
789     <LocationMatch /reports/.*\.xhtml$>
790         SetEnv no-gzip
791     </LocationMatch>
792     <LocationMatch /conify/.*\.html$>
793         SetEnv no-gzip
794     </LocationMatch>
795 </IfModule>
796
797
798 <Location /IDL2js>
799
800     SetHandler perl-script
801     PerlHandler OpenILS::WWW::IDL2js
802     Options +ExecCGI
803     PerlSendHeader On
804     allow from all
805
806     <IfModule mod_headers.c>
807         Header append Cache-Control "public"
808     </IFModule>
809
810     <IfModule mod_deflate.c>
811         SetOutputFilter DEFLATE
812         BrowserMatch ^Mozilla/4 gzip-only-text/html
813         BrowserMatch ^Mozilla/4\.0[678] no-gzip
814         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
815         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
816         <IfModule mod_headers.c>
817             Header append Vary User-Agent env=!dont-vary
818         </IfModule>
819     </IfModule>
820 </Location>
821
822 <LocationMatch /eg/staff/>
823     Options -MultiViews
824     PerlSetVar OILSWebStopAtIndex "true"
825
826     # sample staff-specific translation files
827     #PerlAddVar OILSWebLocale "en_ca"                                           
828     #PerlAddVar OILSWebLocale "/openils/var/data/locale/staff/en-CA.po"         
829     #PerlAddVar OILSWebLocale "fr_ca"                                           
830     #PerlAddVar OILSWebLocale "/openils/var/data/locale/staff/fr-CA.po"   
831 </LocationMatch>
832
833 <Location /js/>
834     <IfModule mod_headers.c>
835         Header append Cache-Control "public"
836     </IFModule>
837     <IfModule mod_deflate.c>
838         SetOutputFilter DEFLATE
839         BrowserMatch ^Mozilla/4 gzip-only-text/html
840         BrowserMatch ^Mozilla/4\.0[678] no-gzip
841         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
842         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
843         <IfModule mod_headers.c>
844             Header append Vary User-Agent env=!dont-vary
845         </IfModule>
846     </IfModule>
847 </Location>
848
849 # Uncomment the following to force SSL for everything. Note that this defeats caching
850 # and you will suffer a performance hit.
851 #RewriteCond %{HTTPS} off
852 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]