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