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