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 /openils/conf/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 SSILegacyExprParser on
99 AddType application/xhtml+xml .xml
101 # - configure mod_xmlent
103 XMLEntEscapeScript "no"
104 XMLEntStripComments "yes"
105 XMLEntContentType "text/html; charset=utf-8"
106 # forces quirks mode which we want for now
107 XMLEntStripDoctype "yes"
109 # - set up the include handlers
111 AddOutputFilter INCLUDES .xsl
112 AddOutputFilter INCLUDES;XMLENT .xml
114 SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
116 # This gives you the option to configure a different host to serve OPAC images from
117 # Specify the hostname (without protocol) and path to the images. Protocol will
118 # be determined at runtime
119 #SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=static.example.org/opac/
121 # In addition to loading images from a static host, you can also load CSS and/or
122 # Javascript from a static host or hosts. Protocol will be determined at runtime
123 # and/or by configuration options immediately following.
124 #SetEnvIf Request_URI ".*" OILS_OPAC_CSS_HOST=static.example.org/opac/
125 #SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=static.example.org/opac/
127 # If you are not able to serve static content via https and
128 # wish to force http:// (and are comfortable with mixed-content
129 # warnings in client browsers), set this:
130 #SetEnvIf Request_URI ".*" OILS_OPAC_STATIC_PROTOCOL=http
132 # If you would prefer to fall back to your non-static servers for
133 # https pages, avoiding mixed-content warnings in client browsers
134 # and are willing to accept some increased server load, set this:
135 #SetEnvIf Request_URI ".*" OILS_OPAC_BYPASS_STATIC_FOR_HTTPS=yes
137 # Specify a ChiliFresh account to integrate their services with the OPAC
138 #SetEnv OILS_CHILIFRESH_ACCOUNT
139 #SetEnv OILS_CHILIFRESH_PROFILE
140 #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
141 #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
143 # Specify the initial script URL for Novelist (containing account credentials, etc.)
144 #SetEnv OILS_NOVELIST_URL
147 # Uncomment to force SSL any time a patron is logged in. This protects
148 # authentication tokens. Left commented out for backwards compat for now.
149 #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
151 # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js
152 #SetEnv OILS_OPAC_COMBINED_JS 1
157 # ----------------------------------------------------------------------------------
158 # Some mod_deflate fun
159 # ----------------------------------------------------------------------------------
160 <IfModule mod_deflate.c>
161 SetOutputFilter DEFLATE
163 BrowserMatch ^Mozilla/4 gzip-only-text/html
164 BrowserMatch ^Mozilla/4\.0[678] no-gzip
165 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
167 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
169 <IfModule mod_headers.c>
170 Header append Vary User-Agent env=!dont-vary
177 # ----------------------------------------------------------------------------------
178 # Some mod_deflate fun
179 # ----------------------------------------------------------------------------------
180 <IfModule mod_deflate.c>
181 SetOutputFilter DEFLATE
183 BrowserMatch ^Mozilla/4 gzip-only-text/html
184 BrowserMatch ^Mozilla/4\.0[678] no-gzip
185 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
187 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
189 <IfModule mod_headers.c>
190 Header append Vary User-Agent env=!dont-vary
196 # ----------------------------------------------------------------------------------
197 # Force SSL on the OPAC's "My Account" page
198 # ----------------------------------------------------------------------------------
199 <LocationMatch .*/myopac.xml>
203 <LocationMatch /opac/extras/>
204 SSILegacyExprParser on
205 # Force to en-US for now to satisfy bbags.xml
208 AddOutputFilter INCLUDES .xml
209 AddType application/xhtml+xml .xml
212 RewriteCond %{QUERY_STRING} locale=([^&]*)
213 RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
214 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
215 AddOutputFilter INCLUDES;XMLENT .html
218 # ----------------------------------------------------------------------------------
219 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
220 # ----------------------------------------------------------------------------------
221 RewriteCond %{HTTP:Accept-Language} ^([a-z]{2}-[A-Z]{2})$
222 # Default to en-US if we haven't matched a locale of the form xx-YY
223 RewriteRule .? - [S=4]
224 RewriteRule ^/xul/ - [E=locale:en-US]
225 RewriteRule ^/reports/ - [E=locale:en-US]
226 RewriteRule .? - [E=locale:en-US]
227 RewriteRule .? - [S=3]
228 # Otherwise, set our real locale
229 RewriteRule ^/xul/ - [E=locale:%{HTTP:Accept-Language}]
230 RewriteRule ^/reports/ - [E=locale:%{HTTP:Accept-Language}]
231 RewriteRule .? - [E=locale:%{HTTP:Accept-Language}]
233 <LocationMatch /xul/.*\.x?html$>
234 SSILegacyExprParser on
236 XMLEntEscapeScript "no"
237 XMLEntStripComments "yes"
239 XMLEntStripDoctype "yes"
240 XMLEntContentType "text/html; charset=utf-8"
241 AddOutputFilter INCLUDES;XMLENT .xhtml
242 AddOutputFilter INCLUDES;XMLENT .html
248 <LocationMatch /xul/.*\.xul$>
249 SSILegacyExprParser on
251 XMLEntContentType "application/vnd.mozilla.xul+xml"
252 AddOutputFilter INCLUDES;XMLENT .xul
257 # ----------------------------------------------------------------------------------
258 # Self-serve password interface
259 # ----------------------------------------------------------------------------------
260 <Location /opac/password>
261 SetHandler perl-script
262 PerlHandler OpenILS::WWW::PasswordReset::password_reset
267 # Force clients to use HTTPS
268 RewriteCond %{HTTPS} !=on [NC]
269 RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
272 # ----------------------------------------------------------------------------------
274 # ----------------------------------------------------------------------------------
275 <Location /opac/extras/oisbn>
276 SetHandler perl-script
277 PerlHandler OpenILS::WWW::SuperCat::oisbn
282 <Location /opac/extras/supercat>
283 SetHandler perl-script
284 PerlHandler OpenILS::WWW::SuperCat::supercat
289 <Location /opac/extras/unapi>
290 SetHandler perl-script
291 PerlHandler OpenILS::WWW::SuperCat::unapi
296 <Location /opac/extras/feed/bookbag>
297 SetHandler perl-script
298 PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
303 <Location /opac/extras/opensearch>
304 SetHandler perl-script
305 PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
310 <Location /opac/extras/sru>
311 SetHandler perl-script
312 PerlHandler OpenILS::WWW::SuperCat::sru_search
317 <Location /opac/extras/sru_auth>
318 SetHandler perl-script
319 PerlHandler OpenILS::WWW::SuperCat::sru_auth_search
324 <Location /opac/extras/feed/freshmeat>
325 SetHandler perl-script
326 PerlHandler OpenILS::WWW::SuperCat::changes_feed
331 <Location /opac/extras/browse>
332 SetHandler perl-script
333 PerlHandler OpenILS::WWW::SuperCat::string_browse
338 <Location /opac/extras/startwith>
339 SetHandler perl-script
340 PerlHandler OpenILS::WWW::SuperCat::string_startwith
346 # ----------------------------------------------------------------------------------
347 # Module for displaying OpenSRF API documentation
348 # ----------------------------------------------------------------------------------
349 <Location /opac/extras/docgen.xsl>
350 AddOutputFilter INCLUDES .xsl
353 # ----------------------------------------------------------------------------------
354 # Module for processing staff-client offline scripts lives here
355 # ----------------------------------------------------------------------------------
356 <Directory "/openils/var/cgi-bin/offline">
357 AddHandler cgi-script .pl
364 # ----------------------------------------------------------------------------------
365 # XXX Note, it's important to explicitly set the JSON encoding style
366 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change
368 # ----------------------------------------------------------------------------------
369 # OpenSRF JSON legacy gateway
370 # ----------------------------------------------------------------------------------
372 SetHandler osrf_json_gateway_module
373 OSRFGatewayLegacyJSON "true"
376 # ----------------------------------------------------------------------------------
377 # New-style OpenSRF JSON gateway
378 # ----------------------------------------------------------------------------------
379 <Location /osrf-gateway-v1>
380 SetHandler osrf_json_gateway_module
381 OSRFGatewayLegacyJSON "false"
385 # ----------------------------------------------------------------------------------
386 # OpenSRF-over-HTTP translator
387 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
388 # ----------------------------------------------------------------------------------
389 <Location /osrf-http-translator>
390 SetHandler osrf_http_translator_module
394 # ----------------------------------------------------------------------------------
395 # The exporter lives here
396 # ----------------------------------------------------------------------------------
398 SetHandler perl-script
400 AuthName "Exporter Login"
401 PerlOptions +GlobalRequest
402 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
403 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
405 PerlHandler OpenILS::WWW::Exporter
411 <Location /opac/extras/merge_template>
412 SetHandler perl-script
414 AuthName "Batch Update Login"
415 PerlOptions +GlobalRequest
416 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
417 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
419 PerlHandler OpenILS::WWW::TemplateBatchBibUpdate
425 <Location /opac/extras/circ>
427 AuthName "Circ Extras Login"
428 PerlOptions +GlobalRequest
429 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
430 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
437 <Location /collections>
438 SetHandler perl-script
440 AuthName "Collections Login"
441 PerlOptions +GlobalRequest
442 PerlSetVar OILSProxyPermissions "money.collections_tracker.create"
443 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
451 # ----------------------------------------------------------------------------------
452 # Reporting output lives here
453 # ----------------------------------------------------------------------------------
454 <Location /reporter/>
456 AuthName "Report Login"
457 PerlOptions +GlobalRequest
458 PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
459 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
466 # ----------------------------------------------------------------------------------
467 # Selfcheck interface
468 # ----------------------------------------------------------------------------------
469 <LocationMatch .*/selfcheck.xml>
471 AuthName "Self-check Login"
472 PerlOptions +GlobalRequest
473 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
474 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
482 # ----------------------------------------------------------------------------------
484 # ----------------------------------------------------------------------------------
485 <LocationMatch /reports>
486 SSILegacyExprParser on
488 AddOutputFilter INCLUDES;XMLENT .xhtml
491 <LocationMatch /reports/fm_IDL.xml>
492 IDLChunkStripPI "yes"
493 IDLChunkEscapeScript "no"
494 IDLChunkStripComments "yes"
495 IDLChunkStripDoctype "yes"
496 IDLChunkContentType "application/xml; charset=utf-8"
497 AddOutputFilter INCLUDES;IDLCHUNK .xml
500 # ----------------------------------------------------------------------------------
502 # ----------------------------------------------------------------------------------
504 SetHandler perl-script
505 PerlHandler OpenILS::WWW::EDI
511 # ----------------------------------------------------------------------------------
513 # ----------------------------------------------------------------------------------
515 SetHandler perl-script
516 PerlHandler OpenILS::WWW::XMLRPCGateway
522 # ----------------------------------------------------------------------------------
523 # Conify - next-generation Evergreen administration interface
524 # ----------------------------------------------------------------------------------
525 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
527 SSILegacyExprParser on
530 XMLEntEscapeScript "no"
531 XMLEntStripComments "no"
532 XMLEntContentType "text/html; charset=utf-8"
533 AddOutputFilter INCLUDES;XMLENT .html
536 AuthName "Dojo Admin Login"
537 PerlOptions +GlobalRequest
538 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
539 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
546 <Location /vandelay-upload>
547 SetHandler perl-script
548 PerlHandler OpenILS::WWW::Vandelay::spool_marc
553 # OpenURL 0.1 searching based on OpenSearch
554 RewriteMap openurl prg:/openils/bin/openurl_map.pl
555 RewriteCond %{QUERY_STRING} (^.*$)
556 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
560 # General Evergreen web template processor
562 SetHandler perl-script
563 PerlHandler OpenILS::WWW::EGWeb
568 PerlSetVar OILSWebBasePath "/eg"
569 PerlSetVar OILSWebWebDir "/openils/var/web"
570 PerlSetVar OILSWebDefaultTemplateExtension "tt2"
572 # Enable Template-Toolkit error debugging messages (apache error log)
573 PerlSetVar OILSWebDebugTemplate "true"
575 # -------------------------------------------------------
576 # Media Prefix. In the 3rd example, the protocol (http) is enforced
577 #PerlSetVar OILSWebMediaPrefix "/media"
578 #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
579 #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
581 # Locale messages files:
583 # These appear in pairs; the first represents the user agent
584 # Accept-Language header locale, and the second represents
585 # the fully-qualified path for the corresponding PO file that
586 # contains the messages.
588 # If you enable two or more locales, then users will be able to
589 # select their preferred locale from a locale picker in the TPAC.
591 #PerlAddVar OILSWebLocale "en"
592 #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en.po"
593 #PerlAddVar OILSWebLocale "en_ca"
594 #PerlAddVar OILSWebLocale "/openils/var/data/locale/en-CA.po"
595 #PerlAddVar OILSWebLocale "fr_ca"
596 #PerlAddVar OILSWebLocale "/openils/var/data/locale/fr-CA.po"
598 # Set the default locale: defaults to en-US
599 #PerlAddVar OILSWebDefaultLocale "fr_ca"
601 # Templates will be loaded from the following paths in reverse order.
602 PerlAddVar OILSWebTemplatePath "/openils/var/templates"
603 #PerlAddVar OILSWebTemplatePath "/openils/var/templates_localskin"
605 #-------------------------------------------------
606 # Added Content Configuration
607 #-------------------------------------------------
609 #SetEnv OILS_CONTENT_CAFE_USER MYUSER
610 #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
613 #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
614 #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
617 #SetEnv OILS_CHILIFRESH_ACCOUNT
618 #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
619 #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
622 # SetEnv OILS_NOVELIST_URL http://imageserver.ebscohost.com/novelistselect/ns2init.js
623 # SetEnv OILS_NOVELIST_PROFILE <profile>
624 # SetEnv OILS_NOVELIST_PASSWORD <password>
626 #-------------------------------------------------
628 <IfModule mod_deflate.c>
629 SetOutputFilter DEFLATE
630 BrowserMatch ^Mozilla/4 gzip-only-text/html
631 BrowserMatch ^Mozilla/4\.0[678] no-gzip
632 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
633 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
634 <IfModule mod_headers.c>
635 Header append Cache-Control "public"
636 Header append Vary User-Agent env=!dont-vary
640 <LocationMatch ^/(images|css|js)/>
641 # should pick up the default expire time from eg.conf...
642 <IfModule mod_deflate.c>
643 SetOutputFilter DEFLATE
644 BrowserMatch ^Mozilla/4 gzip-only-text/html
645 BrowserMatch ^Mozilla/4\.0[678] no-gzip
646 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
647 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
648 <IfModule mod_headers.c>
649 Header append Cache-Control "public"
650 Header append Vary User-Agent env=!dont-vary
655 PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
656 # Expire the HTML quickly since we're loading dynamic data for each page
658 ExpiresByType text/html "access plus 5 seconds"
661 PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader"
662 PerlSetVar KPacConfigFile "/openils/conf/kpac.xml.example"
664 ExpiresByType text/html "access plus 5 seconds"
667 # Note: the template processor will decline handling anything it does not
668 # have an explicit configuration for, which means it will fall back to
669 # Apache to serve the file. However, in the interest of speed, go ahead
670 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
671 # Add more exemptions as needed.
672 <LocationMatch ^/eg/.*(\.js|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
676 # ----------------------------------------------------------------------------------
677 # Some mod_deflate logging setup
678 # ----------------------------------------------------------------------------------
679 <IfModule mod_deflate.c>
680 DeflateFilterNote Input instream
681 DeflateFilterNote Output outstream
682 DeflateFilterNote Ratio ratio
684 LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
685 CustomLog /var/log/apache2/deflate_log deflate
687 # There are problems with XMLENT and mod_deflate - so lets disable it
688 # This is where we don't have a pre-existing LocationMatch directive earlier
689 <LocationMatch /opac/.*\.xml$>
692 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
695 <LocationMatch /reports/.*\.xhtml$>
698 <LocationMatch /conify/.*\.html$>
706 SetHandler perl-script
707 PerlHandler OpenILS::WWW::IDL2js
712 <IfModule mod_headers.c>
713 Header append Cache-Control "public"
716 <IfModule mod_deflate.c>
717 SetOutputFilter DEFLATE
718 BrowserMatch ^Mozilla/4 gzip-only-text/html
719 BrowserMatch ^Mozilla/4\.0[678] no-gzip
720 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
721 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
722 <IfModule mod_headers.c>
723 Header append Vary User-Agent env=!dont-vary
728 # Uncomment the following to force SSL for everything. Note that this defeats caching
729 # and you will suffer a performance hit.
730 #RewriteCond %{HTTPS} off
731 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]