]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/apache/eg_vhost.conf.in
c692fd73c3934ca3bb291c1c07c1e7d35e52c9f6
[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 RewriteCond %{QUERY_STRING} locale=([^&]*)
282 RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
283 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
284     AddOutputFilter INCLUDES;XMLENT .html
285 </LocationMatch>
286
287 # ----------------------------------------------------------------------------------
288 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
289 # ----------------------------------------------------------------------------------
290 RewriteCond %{HTTP:Accept-Language} ^([a-z]{2}-[A-Z]{2})$
291 # Default to en-US if we haven't matched a locale of the form xx-YY 
292 RewriteRule .? - [S=4]
293 RewriteRule ^/xul/      -       [E=locale:en-US]
294 RewriteRule ^/reports/  -       [E=locale:en-US]
295 RewriteRule .? - [E=locale:en-US]
296 RewriteRule .? - [S=3]
297 # Otherwise, set our real locale
298 RewriteRule ^/xul/      -       [E=locale:%{HTTP:Accept-Language}]
299 RewriteRule ^/reports/  -       [E=locale:%{HTTP:Accept-Language}]
300 RewriteRule .? - [E=locale:%{HTTP:Accept-Language}]
301
302 <LocationMatch /xul/.*\.x?html$>
303     Options +Includes
304     XMLEntEscapeScript "no"
305     XMLEntStripComments "yes"
306     XMLEntStripPI "yes"
307     XMLEntStripDoctype "yes"
308     XMLEntContentType "text/html; charset=utf-8"
309     AddOutputFilter INCLUDES;XMLENT .xhtml
310     AddOutputFilter INCLUDES;XMLENT .html
311     SetEnv no-gzip
312     allow from all
313 </LocationMatch>
314
315
316 <LocationMatch /xul/.*\.xul$>
317     Options +Includes
318     XMLEntContentType "application/vnd.mozilla.xul+xml"
319     AddOutputFilter INCLUDES;XMLENT .xul
320     SetEnv no-gzip
321     allow from all
322 </LocationMatch>
323
324 # ----------------------------------------------------------------------------------
325 # Supercat feeds
326 # ----------------------------------------------------------------------------------
327 <Location /opac/extras/oisbn>
328     SetHandler perl-script
329     PerlHandler OpenILS::WWW::SuperCat::oisbn
330     Options +ExecCGI
331     PerlSendHeader On
332     allow from all
333 </Location>
334 <Location /opac/extras/supercat>
335     SetHandler perl-script
336     PerlHandler OpenILS::WWW::SuperCat::supercat
337     Options +ExecCGI
338     PerlSendHeader On
339     allow from all
340 </Location>
341 <Location /opac/extras/unapi>
342     SetHandler perl-script
343     PerlHandler OpenILS::WWW::SuperCat::unapi
344     Options +ExecCGI
345     PerlSendHeader On
346     allow from all
347 </Location>
348 <Location /opac/extras/feed/bookbag>
349     SetHandler perl-script
350     PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
351     Options +ExecCGI
352     PerlSendHeader On
353     allow from all
354 </Location>
355 <Location /opac/extras/opensearch>
356     SetHandler perl-script
357     PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
358     Options +ExecCGI
359     PerlSendHeader On
360     allow from all
361 </Location>
362 <Location /opac/extras/sru>
363     SetHandler perl-script
364     PerlHandler OpenILS::WWW::SuperCat::sru_search
365     Options +ExecCGI
366     PerlSendHeader On
367     allow from all
368 </Location>
369 <Location /opac/extras/sru_auth>
370     SetHandler perl-script
371     PerlHandler OpenILS::WWW::SuperCat::sru_auth_search
372     Options +ExecCGI
373     PerlSendHeader On
374     allow from all
375 </Location>
376 <Location /opac/extras/feed/freshmeat>
377     SetHandler perl-script
378     PerlHandler OpenILS::WWW::SuperCat::changes_feed
379     Options +ExecCGI
380     PerlSendHeader On
381     allow from all
382 </Location>
383 <Location /opac/extras/browse>
384     SetHandler perl-script
385     PerlHandler OpenILS::WWW::SuperCat::string_browse
386     Options +ExecCGI
387     PerlSendHeader On
388     allow from all
389 </Location>     
390 <Location /opac/extras/startwith>
391     SetHandler perl-script
392     PerlHandler OpenILS::WWW::SuperCat::string_startwith
393     Options +ExecCGI
394     PerlSendHeader On
395     allow from all
396 </Location>     
397         
398 # ----------------------------------------------------------------------------------
399 # Module for displaying OpenSRF API documentation
400 # ----------------------------------------------------------------------------------
401 <Location /opac/extras/docgen.xsl>
402     AddOutputFilter INCLUDES .xsl
403 </Location>
404
405 # ----------------------------------------------------------------------------------
406 # Module for processing staff-client offline scripts lives here
407 # ----------------------------------------------------------------------------------
408 <Directory "@localstatedir@/cgi-bin/offline">
409     AddHandler cgi-script .pl
410     AllowOverride None
411     Options +ExecCGI
412     allow from all
413 </Directory>
414         
415         
416 # ----------------------------------------------------------------------------------
417 # XXX Note, it's important to explicitly set the JSON encoding style 
418 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change 
419 # with OpenSRF 1.0
420 # ----------------------------------------------------------------------------------
421 # OpenSRF JSON legacy gateway
422 # ----------------------------------------------------------------------------------
423 <Location /gateway>
424     SetHandler osrf_json_gateway_module
425     OSRFGatewayLegacyJSON "true"
426     allow from all
427 </Location>
428 # ----------------------------------------------------------------------------------
429 # New-style OpenSRF JSON gateway
430 # ----------------------------------------------------------------------------------
431 <Location /osrf-gateway-v1>
432     SetHandler osrf_json_gateway_module
433     OSRFGatewayLegacyJSON "false"
434     allow from all
435 </Location>
436
437 # ----------------------------------------------------------------------------------
438 # OpenSRF-over-HTTP translator
439 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
440 # ----------------------------------------------------------------------------------
441 <Location /osrf-http-translator>
442     SetHandler osrf_http_translator_module
443     allow from all
444 </Location>
445
446 # ----------------------------------------------------------------------------------
447 # The exporter lives here
448 # ----------------------------------------------------------------------------------
449 <Location /exporter>
450     SetHandler perl-script
451     AuthType Basic
452     AuthName "Exporter Login"
453     PerlOptions +GlobalRequest
454     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
455     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
456     require valid-user
457     PerlHandler OpenILS::WWW::Exporter
458     Options +ExecCGI
459     PerlSendHeader On
460     allow from all
461 </Location>
462
463 <Location /opac/extras/merge_template>
464     SetHandler perl-script
465     AuthType Basic
466     AuthName "Batch Update Login"
467     PerlOptions +GlobalRequest
468     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
469     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
470     require valid-user
471     PerlHandler OpenILS::WWW::TemplateBatchBibUpdate
472     PerlSendHeader On
473     Options +ExecCGI
474     allow from all
475 </Location>
476
477 <Location /opac/extras/circ>
478     AuthType Basic
479     AuthName "Circ Extras Login"
480     PerlOptions +GlobalRequest
481     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
482     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
483     require valid-user
484     Options +ExecCGI
485     PerlSendHeader On
486     allow from all
487 </Location>
488
489 <Location /collections>
490     SetHandler perl-script
491     AuthType Basic
492     AuthName "Collections Login"
493     PerlOptions +GlobalRequest
494     PerlSetVar OILSProxyPermissions "money.collections_tracker.create"
495     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
496     require valid-user
497     Options +ExecCGI
498     PerlSendHeader On
499     allow from all
500 </Location>
501
502 # ----------------------------------------------------------------------------------
503 # Protect Standalone/Offline mode files from public view
504 # ----------------------------------------------------------------------------------
505 <Location /standalone/>
506     AuthType Basic
507     AuthName "Standalone Mode Login"
508     PerlOptions +GlobalRequest
509     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
510     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
511     require valid-user
512     PerlSendHeader On
513     allow from all
514     SSLRequireSSL
515 </Location>
516
517 # ----------------------------------------------------------------------------------
518 # Reporting output lives here
519 # ----------------------------------------------------------------------------------
520 <Location /reporter/>
521     AuthType Basic
522     AuthName "Report Login"
523     PerlOptions +GlobalRequest
524     PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
525     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
526     require valid-user
527     Options +ExecCGI
528     PerlSendHeader On
529     allow from all
530 </Location>
531
532 # ----------------------------------------------------------------------------------
533 # Reports GUI
534 # ----------------------------------------------------------------------------------
535 <LocationMatch /reports>
536     Options +Includes
537     AddOutputFilter INCLUDES;XMLENT .xhtml
538 </LocationMatch>
539
540 # capture locale CGI param for /reports/fm_IDL.xml
541 RewriteCond %{REQUEST_URI} ^/reports/fm_IDL.xml
542 RewriteCond %{QUERY_STRING} locale=([^&;]*)
543 RewriteRule . - [E=locale:%1]
544
545 <LocationMatch /reports/fm_IDL.xml>
546     IDLChunkStripPI "yes"
547     IDLChunkEscapeScript "no"
548     IDLChunkStripComments "yes"
549     IDLChunkStripDoctype "yes"
550     IDLChunkContentType "application/xml; charset=utf-8"
551     AddOutputFilter INCLUDES;IDLCHUNK .xml
552     SetEnv no-gzip
553 </LocationMatch>
554
555 # ----------------------------------------------------------------------------------
556 # EDI Message viewer
557 # ----------------------------------------------------------------------------------
558 <Location /edi>
559     SetHandler perl-script
560     PerlHandler OpenILS::WWW::EDI
561     Options +ExecCGI
562     PerlSendHeader On
563     allow from all
564 </Location>     
565
566 # ----------------------------------------------------------------------------------
567 # XML-RPC gateway
568 # ----------------------------------------------------------------------------------
569 <Location /xml-rpc>
570     SetHandler perl-script
571     PerlHandler OpenILS::WWW::XMLRPCGateway
572     Options +ExecCGI
573     PerlSendHeader On
574     allow from all
575     <IfModule mod_headers.c>
576         Header onsuccess set Cache-Control no-cache
577     </IfModule>
578 </Location>
579
580 # ----------------------------------------------------------------------------------
581 # Conify - next-generation Evergreen administration interface
582 # ----------------------------------------------------------------------------------
583 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
584 <Location /conify>
585     Options +Includes
586     XMLEntStripPI "yes"
587     XMLEntEscapeScript "no"
588     XMLEntStripComments "no"
589     XMLEntContentType "text/html; charset=utf-8"
590     AddOutputFilter INCLUDES;XMLENT .html
591  
592     AuthType Basic
593     AuthName "Dojo Admin Login"
594     PerlOptions +GlobalRequest
595     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
596     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
597     require valid-user
598     Options +ExecCGI
599     PerlSendHeader On
600     allow from all
601 </Location>
602
603 # ----------------------------------------------------------------------------------
604 # The PhoneList lives here
605 # ----------------------------------------------------------------------------------
606 <Location /phonelist>
607     SetHandler perl-script
608     AuthType Basic
609     AuthName "PhoneList Login"
610     require valid-user
611     PerlOptions +GlobalRequest
612     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
613     PerlHandler OpenILS::WWW::PhoneList
614     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
615     Options +ExecCGI
616     PerlSendHeader On
617     allow from all
618     <IfModule mod_headers.c>
619         Header onsuccess set Cache-Control no-cache
620     </IfModule>
621 </Location>
622 <Location /vandelay-upload>
623     SetHandler perl-script
624     PerlHandler OpenILS::WWW::Vandelay::spool_marc
625     Options +ExecCGI
626     allow from all
627 </Location>
628
629 # OpenURL 0.1 searching based on OpenSearch
630 RewriteMap openurl prg:@bindir@/openurl_map.pl
631 RewriteCond %{QUERY_STRING} (^.*$)
632 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
633
634
635
636 # General Evergreen web template processor
637 <Location /eg>
638     SetHandler perl-script
639     PerlHandler OpenILS::WWW::EGWeb
640     Options +ExecCGI
641     PerlSendHeader On
642     allow from all
643
644     PerlSetVar OILSWebBasePath "/eg"
645     PerlSetVar OILSWebWebDir "@localstatedir@/web"
646     PerlSetVar OILSWebDefaultTemplateExtension "tt2"
647
648     # Enable Template-Toolkit error debugging messages (apache error log)
649     PerlSetVar OILSWebDebugTemplate "false"
650     # local cache of compiled Template Toolkit templates
651     PerlSetVar OILSWebCompiledTemplateCache "/tmp/eg_template_cache"
652     # template TTL - how long, in seconds, that Template Toolkit
653     # waits to check for updated template files
654     #PerlSetVar OILSWebTemplateStatTTL 60
655
656     # -------------------------------------------------------
657     # Media Prefix.  In the 3rd example, the protocol (http) is enforced
658     #PerlSetVar OILSWebMediaPrefix "/media"
659     #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
660     #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
661
662     # Locale messages files:
663     #
664     # These appear in pairs; the first represents the user agent
665     # Accept-Language header locale, and the second represents
666     # the fully-qualified path for the corresponding PO file that
667     # contains the messages.
668     #
669     # If you enable two or more locales, then users will be able to
670     # select their preferred locale from a locale picker in the TPAC.
671     #
672     #PerlAddVar OILSWebLocale "en"
673     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/messages.en.po"
674     #PerlAddVar OILSWebLocale "en_ca"
675     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/en-CA.po"
676     #PerlAddVar OILSWebLocale "fr_ca"
677     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/fr-CA.po"
678
679     # Set the default locale: defaults to en-US
680     #PerlAddVar OILSWebDefaultLocale "fr_ca"
681     
682     # Templates will be loaded from the following paths in reverse order.
683     PerlAddVar OILSWebTemplatePath "@localstatedir@/templates"
684     #PerlAddVar OILSWebTemplatePath "@localstatedir@/templates_localskin"
685
686     #-------------------------------------------------
687     # Added Content Configuration
688     #-------------------------------------------------
689     # Content Cafe
690     #SetEnv OILS_CONTENT_CAFE_USER MYUSER
691     #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
692     
693     # LibraryThing
694     #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
695     #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
696     
697     # ChiliFresh
698     #SetEnv OILS_CHILIFRESH_ACCOUNT
699     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
700     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
701     #-------------------------------------------------
702
703     <IfModule mod_deflate.c>
704         SetOutputFilter DEFLATE
705         BrowserMatch ^Mozilla/4 gzip-only-text/html
706         BrowserMatch ^Mozilla/4\.0[678] no-gzip
707         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
708         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
709         <IfModule mod_headers.c>
710             Header append Cache-Control "public"
711             Header append Vary User-Agent env=!dont-vary
712         </IfModule>
713     </IfModule>
714 </Location>
715 <LocationMatch ^/(images|css|js)/>
716     # should pick up the default expire time from eg.conf...
717     <IfModule mod_deflate.c>
718         SetOutputFilter DEFLATE
719         BrowserMatch ^Mozilla/4 gzip-only-text/html
720         BrowserMatch ^Mozilla/4\.0[678] no-gzip
721         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
722         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
723         <IfModule mod_headers.c>
724             Header append Cache-Control "public"
725             Header append Vary User-Agent env=!dont-vary
726         </IfModule>
727     </IfModule>
728 </LocationMatch>
729 <Location /eg/opac>
730     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
731     # Expire the HTML quickly since we're loading dynamic data for each page
732     ExpiresActive On
733     ExpiresByType text/html "access plus 5 seconds"
734 </Location>
735 <Location /eg/kpac>
736     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader"
737     PerlSetVar KPacConfigFile "@sysconfdir@/kpac.xml.example"
738     ExpiresActive On
739     ExpiresByType text/html "access plus 5 seconds"
740 </Location>
741
742 # Note: the template processor will decline handling anything it does not
743 # have an explicit configuration for, which means it will fall back to 
744 # Apache to serve the file.  However, in the interest of speed, go ahead 
745 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
746 # Add more exemptions as needed.
747 <LocationMatch ^/eg/.*(\.js|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
748     SetHandler None
749 </LocationMatch>
750
751 # ----------------------------------------------------------------------------------
752 # Some mod_deflate setup
753 # ----------------------------------------------------------------------------------
754 <IfModule mod_deflate.c>
755     ## optional logging for mod_deflate debugging
756     ##DeflateFilterNote Input instream
757     ##DeflateFilterNote Output outstream
758     ##DeflateFilterNote Ratio ratio
759     ##
760     ##LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
761     ##CustomLog /var/log/apache2/deflate_log deflate
762
763     # There are problems with XMLENT and mod_deflate - so lets disable it
764     # This is where we don't have a pre-existing LocationMatch directive earlier
765     <LocationMatch /opac/.*\.xml$>
766         SetEnv no-gzip
767     </LocationMatch>
768     <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
769         SetEnv no-gzip
770     </LocationMatch>
771     <LocationMatch /reports/.*\.xhtml$>
772         SetEnv no-gzip
773     </LocationMatch>
774     <LocationMatch /conify/.*\.html$>
775         SetEnv no-gzip
776     </LocationMatch>
777 </IfModule>
778
779
780 <Location /IDL2js>
781
782     SetHandler perl-script
783     PerlHandler OpenILS::WWW::IDL2js
784     Options +ExecCGI
785     PerlSendHeader On
786     allow from all
787
788     <IfModule mod_headers.c>
789         Header append Cache-Control "public"
790     </IFModule>
791
792     <IfModule mod_deflate.c>
793         SetOutputFilter DEFLATE
794         BrowserMatch ^Mozilla/4 gzip-only-text/html
795         BrowserMatch ^Mozilla/4\.0[678] no-gzip
796         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
797         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
798         <IfModule mod_headers.c>
799             Header append Vary User-Agent env=!dont-vary
800         </IfModule>
801     </IfModule>
802 </Location>
803
804 <LocationMatch /eg/staff/>
805     Options -MultiViews
806     PerlSetVar OILSWebStopAtIndex "true"
807
808     # sample staff-specific translation files
809     #PerlAddVar OILSWebLocale "en_ca"                                           
810     #PerlAddVar OILSWebLocale "/openils/var/data/locale/staff/en-CA.po"         
811     #PerlAddVar OILSWebLocale "fr_ca"                                           
812     #PerlAddVar OILSWebLocale "/openils/var/data/locale/staff/fr-CA.po"   
813 </LocationMatch>
814
815 <Location /js/>
816     <IfModule mod_headers.c>
817         Header append Cache-Control "public"
818     </IFModule>
819     <IfModule mod_deflate.c>
820         SetOutputFilter DEFLATE
821         BrowserMatch ^Mozilla/4 gzip-only-text/html
822         BrowserMatch ^Mozilla/4\.0[678] no-gzip
823         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
824         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
825         <IfModule mod_headers.c>
826             Header append Vary User-Agent env=!dont-vary
827         </IfModule>
828     </IfModule>
829 </Location>
830
831 # Uncomment the following to force SSL for everything. Note that this defeats caching
832 # and you will suffer a performance hit.
833 #RewriteCond %{HTTPS} off
834 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]