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 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 RewriteRule ^/xul/ - [E=locale:%1]
221 RewriteRule ^/reports/ - [E=locale:%1]
223 # Default to en-US if we haven't matched a locale of the form xx-YY
224 RewriteCond %{HTTP:Accept-Language} !([a-z]{2}-[A-Z]{2})
225 RewriteRule ^/xul/ - [E=locale:en-US]
226 RewriteRule ^/reports/ - [E=locale:en-US]
228 # Default to en-US if we are just given en
229 RewriteCond %{ENV:locale} ^$ [OR]
230 RewriteCond %{ENV:locale} ^en$
231 RewriteRule . - [E=locale:en-US]
233 <LocationMatch /xul/.*\.x?html$>
235 XMLEntEscapeScript "no"
236 XMLEntStripComments "yes"
238 XMLEntStripDoctype "yes"
239 XMLEntContentType "text/html; charset=utf-8"
240 AddOutputFilter INCLUDES;XMLENT .xhtml
241 AddOutputFilter INCLUDES;XMLENT .html
247 <LocationMatch /xul/.*\.xul$>
249 XMLEntContentType "application/vnd.mozilla.xul+xml"
250 AddOutputFilter INCLUDES;XMLENT .xul
255 # ----------------------------------------------------------------------------------
256 # Self-serve password interface
257 # ----------------------------------------------------------------------------------
258 <Location /opac/password>
259 SetHandler perl-script
260 PerlHandler OpenILS::WWW::PasswordReset::password_reset
265 # Force clients to use HTTPS
266 RewriteCond %{HTTPS} !=on [NC]
267 RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
270 # ----------------------------------------------------------------------------------
272 # ----------------------------------------------------------------------------------
273 <Location /opac/extras/oisbn>
274 SetHandler perl-script
275 PerlHandler OpenILS::WWW::SuperCat::oisbn
280 <Location /opac/extras/supercat>
281 SetHandler perl-script
282 PerlHandler OpenILS::WWW::SuperCat::supercat
287 <Location /opac/extras/unapi>
288 SetHandler perl-script
289 PerlHandler OpenILS::WWW::SuperCat::unapi
294 <Location /opac/extras/feed/bookbag>
295 SetHandler perl-script
296 PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
301 <Location /opac/extras/opensearch>
302 SetHandler perl-script
303 PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
308 <Location /opac/extras/sru>
309 SetHandler perl-script
310 PerlHandler OpenILS::WWW::SuperCat::sru_search
315 <Location /opac/extras/sru_auth>
316 SetHandler perl-script
317 PerlHandler OpenILS::WWW::SuperCat::sru_auth_search
322 <Location /opac/extras/feed/freshmeat>
323 SetHandler perl-script
324 PerlHandler OpenILS::WWW::SuperCat::changes_feed
329 <Location /opac/extras/browse>
330 SetHandler perl-script
331 PerlHandler OpenILS::WWW::SuperCat::string_browse
336 <Location /opac/extras/startwith>
337 SetHandler perl-script
338 PerlHandler OpenILS::WWW::SuperCat::string_startwith
344 # ----------------------------------------------------------------------------------
345 # Module for displaying OpenSRF API documentation
346 # ----------------------------------------------------------------------------------
347 <Location /opac/extras/docgen.xsl>
348 AddOutputFilter INCLUDES .xsl
351 # ----------------------------------------------------------------------------------
352 # Module for processing staff-client offline scripts lives here
353 # ----------------------------------------------------------------------------------
354 <Directory "/openils/var/cgi-bin/offline">
355 AddHandler cgi-script .pl
362 # ----------------------------------------------------------------------------------
363 # XXX Note, it's important to explicitly set the JSON encoding style
364 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change
366 # ----------------------------------------------------------------------------------
367 # OpenSRF JSON legacy gateway
368 # ----------------------------------------------------------------------------------
370 SetHandler osrf_json_gateway_module
371 OSRFGatewayLegacyJSON "true"
374 # ----------------------------------------------------------------------------------
375 # New-style OpenSRF JSON gateway
376 # ----------------------------------------------------------------------------------
377 <Location /osrf-gateway-v1>
378 SetHandler osrf_json_gateway_module
379 OSRFGatewayLegacyJSON "false"
383 # ----------------------------------------------------------------------------------
384 # OpenSRF-over-HTTP translator
385 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
386 # ----------------------------------------------------------------------------------
387 <Location /osrf-http-translator>
388 SetHandler osrf_http_translator_module
392 # ----------------------------------------------------------------------------------
393 # The exporter lives here
394 # ----------------------------------------------------------------------------------
396 SetHandler perl-script
398 AuthName "Exporter Login"
399 PerlOptions +GlobalRequest
400 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
401 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
403 PerlHandler OpenILS::WWW::Exporter
409 <Location /opac/extras/merge_template>
410 SetHandler perl-script
412 AuthName "Batch Update Login"
413 PerlOptions +GlobalRequest
414 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
415 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
417 PerlHandler OpenILS::WWW::TemplateBatchBibUpdate
423 <Location /opac/extras/circ>
425 AuthName "Circ Extras Login"
426 PerlOptions +GlobalRequest
427 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
428 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
435 <Location /collections>
436 SetHandler perl-script
438 AuthName "Collections Login"
439 PerlOptions +GlobalRequest
440 PerlSetVar OILSProxyPermissions "money.collections_tracker.create"
441 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
449 # ----------------------------------------------------------------------------------
450 # Reporting output lives here
451 # ----------------------------------------------------------------------------------
452 <Location /reporter/>
454 AuthName "Report Login"
455 PerlOptions +GlobalRequest
456 PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
457 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
464 # ----------------------------------------------------------------------------------
465 # Selfcheck interface
466 # ----------------------------------------------------------------------------------
467 <LocationMatch .*/selfcheck.xml>
469 AuthName "Self-check Login"
470 PerlOptions +GlobalRequest
471 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
472 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
480 # ----------------------------------------------------------------------------------
482 # ----------------------------------------------------------------------------------
483 <LocationMatch /reports>
485 AddOutputFilter INCLUDES;XMLENT .xhtml
488 <LocationMatch /reports/fm_IDL.xml>
489 IDLChunkStripPI "yes"
490 IDLChunkEscapeScript "no"
491 IDLChunkStripComments "yes"
492 IDLChunkStripDoctype "yes"
493 IDLChunkContentType "application/xml; charset=utf-8"
494 AddOutputFilter INCLUDES;IDLCHUNK .xml
497 # ----------------------------------------------------------------------------------
499 # ----------------------------------------------------------------------------------
501 SetHandler perl-script
502 PerlHandler OpenILS::WWW::EDI
508 # ----------------------------------------------------------------------------------
510 # ----------------------------------------------------------------------------------
512 SetHandler perl-script
513 PerlHandler OpenILS::WWW::XMLRPCGateway
519 # ----------------------------------------------------------------------------------
520 # Conify - next-generation Evergreen administration interface
521 # ----------------------------------------------------------------------------------
522 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
526 XMLEntEscapeScript "no"
527 XMLEntStripComments "no"
528 XMLEntContentType "text/html; charset=utf-8"
529 AddOutputFilter INCLUDES;XMLENT .html
532 AuthName "Dojo Admin Login"
533 PerlOptions +GlobalRequest
534 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
535 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
542 <Location /vandelay-upload>
543 SetHandler perl-script
544 PerlHandler OpenILS::WWW::Vandelay::spool_marc
549 # OpenURL 0.1 searching based on OpenSearch
550 RewriteMap openurl prg:/openils/bin/openurl_map.pl
551 RewriteCond %{QUERY_STRING} (^.*$)
552 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
556 # General Evergreen web template processor
558 SetHandler perl-script
559 PerlHandler OpenILS::WWW::EGWeb
564 PerlSetVar OILSWebBasePath "/eg"
565 PerlSetVar OILSWebWebDir "/openils/var/web"
566 PerlSetVar OILSWebDefaultTemplateExtension "tt2"
568 # Enable Template-Toolkit error debugging messages (apache error log)
569 PerlSetVar OILSWebDebugTemplate "true"
571 # -------------------------------------------------------
572 # Media Prefix. In the 3rd example, the protocol (http) is enforced
573 #PerlSetVar OILSWebMediaPrefix "/media"
574 #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
575 #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
577 # Locale messages files
578 #PerlAddVar OILSWebLocale "en"
579 #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en.po"
580 #PerlAddVar OILSWebLocale "en_ca"
581 #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en_ca.po"
582 #PerlAddVar OILSWebLocale "fr_ca"
583 #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.fr_ca.po"
585 # Templates will be loaded from the following paths in reverse order.
586 PerlAddVar OILSWebTemplatePath "/openils/var/templates"
587 #PerlAddVar OILSWebTemplatePath "/openils/var/templates_localskin"
589 #-------------------------------------------------
590 # Added Content Configuration
591 #-------------------------------------------------
593 #SetEnv OILS_CONTENT_CAFE_USER MYUSER
594 #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
597 #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
598 #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
601 #SetEnv OILS_CHILIFRESH_ACCOUNT
602 #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
603 #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
604 #-------------------------------------------------
606 <IfModule mod_deflate.c>
607 SetOutputFilter DEFLATE
608 BrowserMatch ^Mozilla/4 gzip-only-text/html
609 BrowserMatch ^Mozilla/4\.0[678] no-gzip
610 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
611 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
612 <IfModule mod_headers.c>
613 Header append Cache-Control "public"
614 Header append Vary User-Agent env=!dont-vary
618 <LocationMatch ^/(images|css|js)/>
619 # should pick up the default expire time from eg.conf...
620 <IfModule mod_deflate.c>
621 SetOutputFilter DEFLATE
622 BrowserMatch ^Mozilla/4 gzip-only-text/html
623 BrowserMatch ^Mozilla/4\.0[678] no-gzip
624 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
625 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
626 <IfModule mod_headers.c>
627 Header append Cache-Control "public"
628 Header append Vary User-Agent env=!dont-vary
633 PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
634 # Expire the HTML quickly since we're loading dynamic data for each page
636 ExpiresByType text/html "access plus 5 seconds"
639 PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader"
640 PerlSetVar KPacConfigFile "/openils/conf/kpac.xml.example"
642 ExpiresByType text/html "access plus 5 seconds"
645 # Note: the template processor will decline handling anything it does not
646 # have an explicit configuration for, which means it will fall back to
647 # Apache to serve the file. However, in the interest of speed, go ahead
648 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
649 # Add more exemptions as needed.
650 <LocationMatch ^/eg/.*(\.js|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
654 # ----------------------------------------------------------------------------------
655 # Some mod_deflate logging setup
656 # ----------------------------------------------------------------------------------
657 <IfModule mod_deflate.c>
658 DeflateFilterNote Input instream
659 DeflateFilterNote Output outstream
660 DeflateFilterNote Ratio ratio
662 LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
663 CustomLog /var/log/apache2/deflate_log deflate
665 # There are problems with XMLENT and mod_deflate - so lets disable it
666 # This is where we don't have a pre-existing LocationMatch directive earlier
667 <LocationMatch /opac/.*\.xml$>
670 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
673 <LocationMatch /reports/.*\.xhtml$>
676 <LocationMatch /conify/.*\.html$>
684 SetHandler perl-script
685 PerlHandler OpenILS::WWW::IDL2js
690 <IfModule mod_headers.c>
691 Header append Cache-Control "public"
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 Vary User-Agent env=!dont-vary
706 # Uncomment the following to force SSL for everything. Note that this defeats caching
707 # and you will suffer a performance hit.
708 #RewriteCond %{HTTPS} off
709 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]