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