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