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