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 # ----------------------------------------------------------------------------------
6 # ----------------------------------------------------------------------------------
7 # Point / to the opac - if you have a custom skin or locale, point at it here
8 # ----------------------------------------------------------------------------------
9 RedirectMatch 301 ^/$ /opac/en-US/skin/default/xml/index.xml
11 # ----------------------------------------------------------------------------------
12 # Point / to the IP address redirector
13 # ----------------------------------------------------------------------------------
15 # SetHandler perl-script
16 # PerlHandler OpenILS::WWW::Redirect
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"
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
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
43 # ----------------------------------------------------------------------------------
44 # Added content plugin
45 # ----------------------------------------------------------------------------------
46 <Location /opac/extras/ac/>
47 SetHandler perl-script
48 PerlHandler OpenILS::WWW::AddedContent
54 # Autosuggest for searches
55 <Location /opac/extras/autosuggest>
56 SetHandler perl-script
57 PerlHandler OpenILS::WWW::AutoSuggest
63 <Location /opac/extras/flattener>
64 SetHandler perl-script
65 PerlHandler OpenILS::WWW::FlatFielder
70 # ----------------------------------------------------------------------------------
71 # Replace broken cover images with a transparent GIF by default
72 # ----------------------------------------------------------------------------------
74 RewriteRule ^/opac/extras/ac/jacket/(small|medium|large)/$ \
75 /opac/images/blank.png [P,L]
77 # ----------------------------------------------------------------------------------
78 # Add the row ID (RID) and date so we can make unAPI happy
79 # ----------------------------------------------------------------------------------
80 RewriteCond %{QUERY_STRING} (^r|&r)=(\d+)
81 RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}]
83 # ----------------------------------------------------------------------------------
84 # Pull the locale from the URL
85 # ----------------------------------------------------------------------------------
86 RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
87 RewriteRule . - [E=locale:%1]
89 # ----------------------------------------------------------------------------------
90 # For sanity reasons, default indexes to Off
91 # ----------------------------------------------------------------------------------
94 # ----------------------------------------------------------------------------------
96 # ----------------------------------------------------------------------------------
97 <LocationMatch /opac/>
98 AddType application/xhtml+xml .xml
100 # - configure mod_xmlent
102 XMLEntEscapeScript "no"
103 XMLEntStripComments "yes"
104 XMLEntContentType "text/html; charset=utf-8"
105 # forces quirks mode which we want for now
106 XMLEntStripDoctype "yes"
108 # - set up the include handlers
110 AddOutputFilter INCLUDES .xsl
111 AddOutputFilter INCLUDES;XMLENT .xml
113 SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
115 # This gives you the option to configure a different host to serve OPAC images from
116 # Specify the hostname (without protocol) and path to the images. Protocol will
117 # be determined at runtime
118 #SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=static.example.org/opac/
120 # In addition to loading images from a static host, you can also load CSS and/or
121 # Javascript from a static host or hosts. Protocol will be determined at runtime
122 # and/or by configuration options immediately following.
123 #SetEnvIf Request_URI ".*" OILS_OPAC_CSS_HOST=static.example.org/opac/
124 #SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=static.example.org/opac/
126 # If you are not able to serve static content via https and
127 # wish to force http:// (and are comfortable with mixed-content
128 # warnings in client browsers), set this:
129 #SetEnvIf Request_URI ".*" OILS_OPAC_STATIC_PROTOCOL=http
131 # If you would prefer to fall back to your non-static servers for
132 # https pages, avoiding mixed-content warnings in client browsers
133 # and are willing to accept some increased server load, set this:
134 #SetEnvIf Request_URI ".*" OILS_OPAC_BYPASS_STATIC_FOR_HTTPS=yes
136 # Specify a ChiliFresh account to integrate their services with the OPAC
137 #SetEnv OILS_CHILIFRESH_ACCOUNT
138 #SetEnv OILS_CHILIFRESH_PROFILE
139 #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
140 #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
142 # Specify the initial script URL for Novelist (containing account credentials, etc.)
143 #SetEnv OILS_NOVELIST_URL
146 # Uncomment to force SSL any time a patron is logged in. This protects
147 # authentication tokens. Left commented out for backwards compat for now.
148 #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
150 # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js
151 #SetEnv OILS_OPAC_COMBINED_JS 1
156 # ----------------------------------------------------------------------------------
157 # Some mod_deflate fun
158 # ----------------------------------------------------------------------------------
159 <IfModule mod_deflate.c>
160 SetOutputFilter DEFLATE
162 BrowserMatch ^Mozilla/4 gzip-only-text/html
163 BrowserMatch ^Mozilla/4\.0[678] no-gzip
164 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
166 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
168 <IfModule mod_headers.c>
169 Header append Vary User-Agent env=!dont-vary
176 # ----------------------------------------------------------------------------------
177 # Some mod_deflate fun
178 # ----------------------------------------------------------------------------------
179 <IfModule mod_deflate.c>
180 SetOutputFilter DEFLATE
182 BrowserMatch ^Mozilla/4 gzip-only-text/html
183 BrowserMatch ^Mozilla/4\.0[678] no-gzip
184 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
186 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
188 <IfModule mod_headers.c>
189 Header append Vary User-Agent env=!dont-vary
195 # ----------------------------------------------------------------------------------
196 # Force SSL on the OPAC's "My Account" page
197 # ----------------------------------------------------------------------------------
198 <LocationMatch .*/myopac.xml>
202 <LocationMatch /opac/extras/>
203 # Force to en-US for now to satisfy bbags.xml
206 AddOutputFilter INCLUDES .xml
207 AddType application/xhtml+xml .xml
210 RewriteCond %{QUERY_STRING} locale=([^&]*)
211 RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
212 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
213 AddOutputFilter INCLUDES;XMLENT .html
216 # ----------------------------------------------------------------------------------
217 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
218 # ----------------------------------------------------------------------------------
219 RewriteCond %{HTTP:Accept-Language} ^([a-z]{2}-[A-Z]{2})$
220 # Default to en-US if we haven't matched a locale of the form xx-YY
221 RewriteRule .? - [S=4]
222 RewriteRule ^/xul/ - [E=locale:en-US]
223 RewriteRule ^/reports/ - [E=locale:en-US]
224 RewriteRule .? - [E=locale:en-US]
225 RewriteRule .? - [S=3]
226 # Otherwise, set our real locale
227 RewriteRule ^/xul/ - [E=locale:%{HTTP:Accept-Language}]
228 RewriteRule ^/reports/ - [E=locale:%{HTTP:Accept-Language}]
229 RewriteRule .? - [E=locale:%{HTTP:Accept-Language}]
231 <LocationMatch /xul/.*\.x?html$>
233 XMLEntEscapeScript "no"
234 XMLEntStripComments "yes"
236 XMLEntStripDoctype "yes"
237 XMLEntContentType "text/html; charset=utf-8"
238 AddOutputFilter INCLUDES;XMLENT .xhtml
239 AddOutputFilter INCLUDES;XMLENT .html
245 <LocationMatch /xul/.*\.xul$>
247 XMLEntContentType "application/vnd.mozilla.xul+xml"
248 AddOutputFilter INCLUDES;XMLENT .xul
253 # ----------------------------------------------------------------------------------
254 # Self-serve password interface
255 # ----------------------------------------------------------------------------------
256 <Location /opac/password>
257 SetHandler perl-script
258 PerlHandler OpenILS::WWW::PasswordReset::password_reset
263 # Force clients to use HTTPS
264 RewriteCond %{HTTPS} !=on [NC]
265 RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
268 # ----------------------------------------------------------------------------------
270 # ----------------------------------------------------------------------------------
271 <Location /opac/extras/oisbn>
272 SetHandler perl-script
273 PerlHandler OpenILS::WWW::SuperCat::oisbn
278 <Location /opac/extras/supercat>
279 SetHandler perl-script
280 PerlHandler OpenILS::WWW::SuperCat::supercat
285 <Location /opac/extras/unapi>
286 SetHandler perl-script
287 PerlHandler OpenILS::WWW::SuperCat::unapi
292 <Location /opac/extras/feed/bookbag>
293 SetHandler perl-script
294 PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
299 <Location /opac/extras/opensearch>
300 SetHandler perl-script
301 PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
306 <Location /opac/extras/sru>
307 SetHandler perl-script
308 PerlHandler OpenILS::WWW::SuperCat::sru_search
313 <Location /opac/extras/sru_auth>
314 SetHandler perl-script
315 PerlHandler OpenILS::WWW::SuperCat::sru_auth_search
320 <Location /opac/extras/feed/freshmeat>
321 SetHandler perl-script
322 PerlHandler OpenILS::WWW::SuperCat::changes_feed
327 <Location /opac/extras/browse>
328 SetHandler perl-script
329 PerlHandler OpenILS::WWW::SuperCat::string_browse
334 <Location /opac/extras/startwith>
335 SetHandler perl-script
336 PerlHandler OpenILS::WWW::SuperCat::string_startwith
342 # ----------------------------------------------------------------------------------
343 # Module for displaying OpenSRF API documentation
344 # ----------------------------------------------------------------------------------
345 <Location /opac/extras/docgen.xsl>
346 AddOutputFilter INCLUDES .xsl
349 # ----------------------------------------------------------------------------------
350 # Module for processing staff-client offline scripts lives here
351 # ----------------------------------------------------------------------------------
352 <Directory "@localstatedir@/cgi-bin/offline">
353 AddHandler cgi-script .pl
360 # ----------------------------------------------------------------------------------
361 # XXX Note, it's important to explicitly set the JSON encoding style
362 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change
364 # ----------------------------------------------------------------------------------
365 # OpenSRF JSON legacy gateway
366 # ----------------------------------------------------------------------------------
368 SetHandler osrf_json_gateway_module
369 OSRFGatewayLegacyJSON "true"
372 # ----------------------------------------------------------------------------------
373 # New-style OpenSRF JSON gateway
374 # ----------------------------------------------------------------------------------
375 <Location /osrf-gateway-v1>
376 SetHandler osrf_json_gateway_module
377 OSRFGatewayLegacyJSON "false"
381 # ----------------------------------------------------------------------------------
382 # OpenSRF-over-HTTP translator
383 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
384 # ----------------------------------------------------------------------------------
385 <Location /osrf-http-translator>
386 SetHandler osrf_http_translator_module
390 # ----------------------------------------------------------------------------------
391 # The exporter lives here
392 # ----------------------------------------------------------------------------------
394 SetHandler perl-script
396 AuthName "Exporter Login"
397 PerlOptions +GlobalRequest
398 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
399 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
401 PerlHandler OpenILS::WWW::Exporter
407 <Location /opac/extras/merge_template>
408 SetHandler perl-script
410 AuthName "Batch Update Login"
411 PerlOptions +GlobalRequest
412 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
413 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
415 PerlHandler OpenILS::WWW::TemplateBatchBibUpdate
421 <Location /opac/extras/circ>
423 AuthName "Circ Extras Login"
424 PerlOptions +GlobalRequest
425 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
426 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
433 <Location /collections>
434 SetHandler perl-script
436 AuthName "Collections Login"
437 PerlOptions +GlobalRequest
438 PerlSetVar OILSProxyPermissions "money.collections_tracker.create"
439 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
447 # ----------------------------------------------------------------------------------
448 # Reporting output lives here
449 # ----------------------------------------------------------------------------------
450 <Location /reporter/>
452 AuthName "Report Login"
453 PerlOptions +GlobalRequest
454 PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
455 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
462 # ----------------------------------------------------------------------------------
463 # Selfcheck interface
464 # ----------------------------------------------------------------------------------
465 <LocationMatch .*/selfcheck.xml>
467 AuthName "Self-check Login"
468 PerlOptions +GlobalRequest
469 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
470 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
478 # ----------------------------------------------------------------------------------
480 # ----------------------------------------------------------------------------------
481 <LocationMatch /reports>
483 AddOutputFilter INCLUDES;XMLENT .xhtml
486 <LocationMatch /reports/fm_IDL.xml>
487 IDLChunkStripPI "yes"
488 IDLChunkEscapeScript "no"
489 IDLChunkStripComments "yes"
490 IDLChunkStripDoctype "yes"
491 IDLChunkContentType "application/xml; charset=utf-8"
492 AddOutputFilter INCLUDES;IDLCHUNK .xml
495 # ----------------------------------------------------------------------------------
497 # ----------------------------------------------------------------------------------
499 SetHandler perl-script
500 PerlHandler OpenILS::WWW::EDI
506 # ----------------------------------------------------------------------------------
508 # ----------------------------------------------------------------------------------
510 SetHandler perl-script
511 PerlHandler OpenILS::WWW::XMLRPCGateway
517 # ----------------------------------------------------------------------------------
518 # Conify - next-generation Evergreen administration interface
519 # ----------------------------------------------------------------------------------
520 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
524 XMLEntEscapeScript "no"
525 XMLEntStripComments "no"
526 XMLEntContentType "text/html; charset=utf-8"
527 AddOutputFilter INCLUDES;XMLENT .html
530 AuthName "Dojo Admin Login"
531 PerlOptions +GlobalRequest
532 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
533 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
540 <Location /vandelay-upload>
541 SetHandler perl-script
542 PerlHandler OpenILS::WWW::Vandelay::spool_marc
547 # OpenURL 0.1 searching based on OpenSearch
548 RewriteMap openurl prg:@bindir@/openurl_map.pl
549 RewriteCond %{QUERY_STRING} (^.*$)
550 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
554 # General Evergreen web template processor
556 SetHandler perl-script
557 PerlHandler OpenILS::WWW::EGWeb
562 PerlSetVar OILSWebBasePath "/eg"
563 PerlSetVar OILSWebWebDir "@localstatedir@/web"
564 PerlSetVar OILSWebDefaultTemplateExtension "tt2"
566 # Enable Template-Toolkit error debugging messages (apache error log)
567 PerlSetVar OILSWebDebugTemplate "true"
569 # -------------------------------------------------------
570 # Media Prefix. In the 3rd example, the protocol (http) is enforced
571 #PerlSetVar OILSWebMediaPrefix "/media"
572 #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
573 #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
575 # Locale messages files:
577 # These appear in pairs; the first represents the user agent
578 # Accept-Language header locale, and the second represents
579 # the fully-qualified path for the corresponding PO file that
580 # contains the messages.
582 # If you enable two or more locales, then users will be able to
583 # select their preferred locale from a locale picker in the TPAC.
585 #PerlAddVar OILSWebLocale "en"
586 #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/messages.en.po"
587 #PerlAddVar OILSWebLocale "en_ca"
588 #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/en-CA.po"
589 #PerlAddVar OILSWebLocale "fr_ca"
590 #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/fr-CA.po"
592 # Set the default locale: defaults to en-US
593 #PerlAddVar OILSWebDefaultLocale "fr_ca"
595 # Templates will be loaded from the following paths in reverse order.
596 PerlAddVar OILSWebTemplatePath "@localstatedir@/templates"
597 #PerlAddVar OILSWebTemplatePath "@localstatedir@/templates_localskin"
599 #-------------------------------------------------
600 # Added Content Configuration
601 #-------------------------------------------------
603 #SetEnv OILS_CONTENT_CAFE_USER MYUSER
604 #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
607 #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
608 #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
611 #SetEnv OILS_CHILIFRESH_ACCOUNT
612 #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
613 #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
614 #-------------------------------------------------
616 <IfModule mod_deflate.c>
617 SetOutputFilter DEFLATE
618 BrowserMatch ^Mozilla/4 gzip-only-text/html
619 BrowserMatch ^Mozilla/4\.0[678] no-gzip
620 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
621 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
622 <IfModule mod_headers.c>
623 Header append Cache-Control "public"
624 Header append Vary User-Agent env=!dont-vary
628 <LocationMatch ^/(images|css|js)/>
629 # should pick up the default expire time from eg.conf...
630 <IfModule mod_deflate.c>
631 SetOutputFilter DEFLATE
632 BrowserMatch ^Mozilla/4 gzip-only-text/html
633 BrowserMatch ^Mozilla/4\.0[678] no-gzip
634 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
635 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
636 <IfModule mod_headers.c>
637 Header append Cache-Control "public"
638 Header append Vary User-Agent env=!dont-vary
643 PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
644 # Expire the HTML quickly since we're loading dynamic data for each page
646 ExpiresByType text/html "access plus 5 seconds"
649 PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader"
650 PerlSetVar KPacConfigFile "@sysconfdir@/kpac.xml.example"
652 ExpiresByType text/html "access plus 5 seconds"
655 # Note: the template processor will decline handling anything it does not
656 # have an explicit configuration for, which means it will fall back to
657 # Apache to serve the file. However, in the interest of speed, go ahead
658 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
659 # Add more exemptions as needed.
660 <LocationMatch ^/eg/.*(\.js|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
664 # ----------------------------------------------------------------------------------
665 # Some mod_deflate logging setup
666 # ----------------------------------------------------------------------------------
667 <IfModule mod_deflate.c>
668 DeflateFilterNote Input instream
669 DeflateFilterNote Output outstream
670 DeflateFilterNote Ratio ratio
672 LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
673 CustomLog /var/log/apache2/deflate_log deflate
675 # There are problems with XMLENT and mod_deflate - so lets disable it
676 # This is where we don't have a pre-existing LocationMatch directive earlier
677 <LocationMatch /opac/.*\.xml$>
680 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
683 <LocationMatch /reports/.*\.xhtml$>
686 <LocationMatch /conify/.*\.html$>
694 SetHandler perl-script
695 PerlHandler OpenILS::WWW::IDL2js
700 <IfModule mod_headers.c>
701 Header append Cache-Control "public"
704 <IfModule mod_deflate.c>
705 SetOutputFilter DEFLATE
706 BrowserMatch ^Mozilla/4 gzip-only-text/html
707 BrowserMatch ^Mozilla/4\.0[678] no-gzip
708 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
709 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
710 <IfModule mod_headers.c>
711 Header append Vary User-Agent env=!dont-vary
716 # Uncomment the following to force SSL for everything. Note that this defeats caching
717 # and you will suffer a performance hit.
718 #RewriteCond %{HTTPS} off
719 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]