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