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