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