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