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