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