]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/apache/eg_vhost.conf.in
LP#1207281: require SSL when downloading offline patron list
[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     SSLRequireSSL
492 </Location>
493
494 # ----------------------------------------------------------------------------------
495 # Reporting output lives here
496 # ----------------------------------------------------------------------------------
497 <Location /reporter/>
498     AuthType Basic
499     AuthName "Report Login"
500     PerlOptions +GlobalRequest
501     PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
502     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
503     require valid-user
504     Options +ExecCGI
505     PerlSendHeader On
506     allow from all
507 </Location>
508
509 # ----------------------------------------------------------------------------------
510 # Selfcheck interface
511 # ----------------------------------------------------------------------------------
512 <LocationMatch .*/selfcheck.xml>
513     AuthType Basic
514     AuthName "Self-check Login"
515     PerlOptions +GlobalRequest
516     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
517     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
518     require valid-user
519     Options +ExecCGI
520     PerlSendHeader On
521     allow from all
522 </LocationMatch>
523
524
525 # ----------------------------------------------------------------------------------
526 # Reports GUI
527 # ----------------------------------------------------------------------------------
528 <LocationMatch /reports>
529     Options +Includes
530     AddOutputFilter INCLUDES;XMLENT .xhtml
531 </LocationMatch>
532
533 # capture locale CGI param for /reports/fm_IDL.xml
534 RewriteCond %{REQUEST_URI} ^/reports/fm_IDL.xml
535 RewriteCond %{QUERY_STRING} locale=([^&;]*)
536 RewriteRule . - [E=locale:%1]
537
538 <LocationMatch /reports/fm_IDL.xml>
539     IDLChunkStripPI "yes"
540     IDLChunkEscapeScript "no"
541     IDLChunkStripComments "yes"
542     IDLChunkStripDoctype "yes"
543     IDLChunkContentType "application/xml; charset=utf-8"
544     AddOutputFilter INCLUDES;IDLCHUNK .xml
545 </LocationMatch>
546
547 # ----------------------------------------------------------------------------------
548 # EDI Message viewer
549 # ----------------------------------------------------------------------------------
550 <Location /edi>
551     SetHandler perl-script
552     PerlHandler OpenILS::WWW::EDI
553     Options +ExecCGI
554     PerlSendHeader On
555     allow from all
556 </Location>     
557
558 # ----------------------------------------------------------------------------------
559 # XML-RPC gateway
560 # ----------------------------------------------------------------------------------
561 <Location /xml-rpc>
562     SetHandler perl-script
563     PerlHandler OpenILS::WWW::XMLRPCGateway
564     Options +ExecCGI
565     PerlSendHeader On
566     allow from all
567     <IfModule mod_headers.c>
568         Header onsuccess set Cache-Control no-cache
569     </IfModule>
570 </Location>
571
572 # ----------------------------------------------------------------------------------
573 # Conify - next-generation Evergreen administration interface
574 # ----------------------------------------------------------------------------------
575 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
576 <Location /conify>
577     Options +Includes
578     XMLEntStripPI "yes"
579     XMLEntEscapeScript "no"
580     XMLEntStripComments "no"
581     XMLEntContentType "text/html; charset=utf-8"
582     AddOutputFilter INCLUDES;XMLENT .html
583  
584     AuthType Basic
585     AuthName "Dojo Admin Login"
586     PerlOptions +GlobalRequest
587     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
588     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
589     require valid-user
590     Options +ExecCGI
591     PerlSendHeader On
592     allow from all
593 </Location>
594
595 # ----------------------------------------------------------------------------------
596 # The PhoneList lives here
597 # ----------------------------------------------------------------------------------
598 <Location /phonelist>
599     SetHandler perl-script
600     AuthType Basic
601     AuthName "PhoneList Login"
602     require valid-user
603     PerlOptions +GlobalRequest
604     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
605     PerlHandler OpenILS::WWW::PhoneList
606     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
607     Options +ExecCGI
608     PerlSendHeader On
609     allow from all
610     <IfModule mod_headers.c>
611         Header onsuccess set Cache-Control no-cache
612     </IfModule>
613 </Location>
614 <Location /vandelay-upload>
615     SetHandler perl-script
616     PerlHandler OpenILS::WWW::Vandelay::spool_marc
617     Options +ExecCGI
618     allow from all
619 </Location>
620
621 # OpenURL 0.1 searching based on OpenSearch
622 RewriteMap openurl prg:@bindir@/openurl_map.pl
623 RewriteCond %{QUERY_STRING} (^.*$)
624 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
625
626
627
628 # General Evergreen web template processor
629 <Location /eg>
630     SetHandler perl-script
631     PerlHandler OpenILS::WWW::EGWeb
632     Options +ExecCGI
633     PerlSendHeader On
634     allow from all
635
636     PerlSetVar OILSWebBasePath "/eg"
637     PerlSetVar OILSWebWebDir "@localstatedir@/web"
638     PerlSetVar OILSWebDefaultTemplateExtension "tt2"
639
640     # Enable Template-Toolkit error debugging messages (apache error log)
641     PerlSetVar OILSWebDebugTemplate "true"
642
643     # -------------------------------------------------------
644     # Media Prefix.  In the 3rd example, the protocol (http) is enforced
645     #PerlSetVar OILSWebMediaPrefix "/media"
646     #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
647     #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
648
649     # Locale messages files:
650     #
651     # These appear in pairs; the first represents the user agent
652     # Accept-Language header locale, and the second represents
653     # the fully-qualified path for the corresponding PO file that
654     # contains the messages.
655     #
656     # If you enable two or more locales, then users will be able to
657     # select their preferred locale from a locale picker in the TPAC.
658     #
659     #PerlAddVar OILSWebLocale "en"
660     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/messages.en.po"
661     #PerlAddVar OILSWebLocale "en_ca"
662     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/en-CA.po"
663     #PerlAddVar OILSWebLocale "fr_ca"
664     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/fr-CA.po"
665
666     # Set the default locale: defaults to en-US
667     #PerlAddVar OILSWebDefaultLocale "fr_ca"
668     
669     # Templates will be loaded from the following paths in reverse order.
670     PerlAddVar OILSWebTemplatePath "@localstatedir@/templates"
671     #PerlAddVar OILSWebTemplatePath "@localstatedir@/templates_localskin"
672
673     #-------------------------------------------------
674     # Added Content Configuration
675     #-------------------------------------------------
676     # Content Cafe
677     #SetEnv OILS_CONTENT_CAFE_USER MYUSER
678     #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
679     
680     # LibraryThing
681     #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
682     #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
683     
684     # ChiliFresh
685     #SetEnv OILS_CHILIFRESH_ACCOUNT
686     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
687     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
688     #-------------------------------------------------
689
690     <IfModule mod_deflate.c>
691         SetOutputFilter DEFLATE
692         BrowserMatch ^Mozilla/4 gzip-only-text/html
693         BrowserMatch ^Mozilla/4\.0[678] no-gzip
694         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
695         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
696         <IfModule mod_headers.c>
697             Header append Cache-Control "public"
698             Header append Vary User-Agent env=!dont-vary
699         </IfModule>
700     </IfModule>
701 </Location>
702 <LocationMatch ^/(images|css|js)/>
703     # should pick up the default expire time from eg.conf...
704     <IfModule mod_deflate.c>
705         SetOutputFilter DEFLATE
706         BrowserMatch ^Mozilla/4 gzip-only-text/html
707         BrowserMatch ^Mozilla/4\.0[678] no-gzip
708         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
709         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
710         <IfModule mod_headers.c>
711             Header append Cache-Control "public"
712             Header append Vary User-Agent env=!dont-vary
713         </IfModule>
714     </IfModule>
715 </LocationMatch>
716 <Location /eg/opac>
717     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
718     # Expire the HTML quickly since we're loading dynamic data for each page
719     ExpiresActive On
720     ExpiresByType text/html "access plus 5 seconds"
721 </Location>
722 <Location /eg/kpac>
723     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader"
724     PerlSetVar KPacConfigFile "@sysconfdir@/kpac.xml.example"
725     ExpiresActive On
726     ExpiresByType text/html "access plus 5 seconds"
727 </Location>
728
729 # Note: the template processor will decline handling anything it does not
730 # have an explicit configuration for, which means it will fall back to 
731 # Apache to serve the file.  However, in the interest of speed, go ahead 
732 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
733 # Add more exemptions as needed.
734 <LocationMatch ^/eg/.*(\.js|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
735     SetHandler None
736 </LocationMatch>
737
738 # ----------------------------------------------------------------------------------
739 # Some mod_deflate logging setup
740 # ----------------------------------------------------------------------------------
741 <IfModule mod_deflate.c>
742     DeflateFilterNote Input instream
743     DeflateFilterNote Output outstream
744     DeflateFilterNote Ratio ratio
745
746     LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
747     CustomLog /var/log/apache2/deflate_log deflate
748
749     # There are problems with XMLENT and mod_deflate - so lets disable it
750     # This is where we don't have a pre-existing LocationMatch directive earlier
751     <LocationMatch /opac/.*\.xml$>
752         SetEnv no-gzip
753     </LocationMatch>
754     <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
755         SetEnv no-gzip
756     </LocationMatch>
757     <LocationMatch /reports/.*\.xhtml$>
758         SetEnv no-gzip
759     </LocationMatch>
760     <LocationMatch /conify/.*\.html$>
761         SetEnv no-gzip
762     </LocationMatch>
763 </IfModule>
764
765
766 <Location /IDL2js>
767
768     SetHandler perl-script
769     PerlHandler OpenILS::WWW::IDL2js
770     Options +ExecCGI
771     PerlSendHeader On
772     allow from all
773
774     <IfModule mod_headers.c>
775         Header append Cache-Control "public"
776     </IFModule>
777
778     <IfModule mod_deflate.c>
779         SetOutputFilter DEFLATE
780         BrowserMatch ^Mozilla/4 gzip-only-text/html
781         BrowserMatch ^Mozilla/4\.0[678] no-gzip
782         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
783         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
784         <IfModule mod_headers.c>
785             Header append Vary User-Agent env=!dont-vary
786         </IfModule>
787     </IfModule>
788 </Location>
789
790 # Uncomment the following to force SSL for everything. Note that this defeats caching
791 # and you will suffer a performance hit.
792 #RewriteCond %{HTTPS} off
793 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]