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 # ----------------------------------------------------------------------------------
55 # Replace broken cover images with a transparent GIF by default
56 # ----------------------------------------------------------------------------------
58 RewriteRule ^/opac/extras/ac/jacket/(small|medium|large)/$ \
59 /opac/images/blank.png [P,L]
61 # ----------------------------------------------------------------------------------
62 # Add the row ID (RID) and date so we can make unAPI happy
63 # ----------------------------------------------------------------------------------
64 RewriteCond %{QUERY_STRING} (^r|&r)=(\d+)
65 RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}]
67 # ----------------------------------------------------------------------------------
68 # Pull the locale from the URL
69 # ----------------------------------------------------------------------------------
70 RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
71 RewriteRule . - [E=locale:%1]
73 # ----------------------------------------------------------------------------------
75 # ----------------------------------------------------------------------------------
76 <LocationMatch /opac/>
77 AddType application/xhtml+xml .xml
79 # - configure mod_xmlent
81 XMLEntEscapeScript "no"
82 XMLEntStripComments "yes"
83 XMLEntContentType "text/html; charset=utf-8"
84 # forces quirks mode which we want for now
85 XMLEntStripDoctype "yes"
87 # - set up the include handlers
89 AddOutputFilter INCLUDES .xsl
90 AddOutputFilter INCLUDES;XMLENT .xml
92 SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
94 # This gives you the option to configure a different host to serve OPAC images from
95 # Specify the hostname (without protocol) and path to the images. Protocol will
96 # be determined at runtime
97 #SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=static.example.org/opac/
99 # In addition to loading images from a static host, you can also load CSS and/or
100 # Javascript from a static host or hosts. Protocol will be determined at runtime
101 # and/or by configuration options immediately following.
102 #SetEnvIf Request_URI ".*" OILS_OPAC_CSS_HOST=static.example.org/opac/
103 #SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=static.example.org/opac/
105 # If you are not able to serve static content via https and
106 # wish to force http:// (and are comfortable with mixed-content
107 # warnings in client browsers), set this:
108 #SetEnvIf Request_URI ".*" OILS_OPAC_STATIC_PROTOCOL=http
110 # If you would prefer to fall back to your non-static servers for
111 # https pages, avoiding mixed-content warnings in client browsers
112 # and are willing to accept some increased server load, set this:
113 #SetEnvIf Request_URI ".*" OILS_OPAC_BYPASS_STATIC_FOR_HTTPS=yes
115 # Specify a ChiliFresh account to integrate their services with the OPAC
116 #SetEnv OILS_CHILIFRESH_ACCOUNT
117 #SetEnv OILS_CHILIFRESH_PROFILE
118 #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
119 #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
121 # Specify the initial script URL for Novelist (containing account credentials, etc.)
122 #SetEnv OILS_NOVELIST_URL
125 # Uncomment to force SSL any time a patron is logged in. This protects
126 # authentication tokens. Left commented out for backwards compat for now.
127 #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
129 # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js
130 #SetEnv OILS_OPAC_COMBINED_JS 1
135 # ----------------------------------------------------------------------------------
136 # Some mod_deflate fun
137 # ----------------------------------------------------------------------------------
138 <IfModule mod_deflate.c>
139 SetOutputFilter DEFLATE
141 BrowserMatch ^Mozilla/4 gzip-only-text/html
142 BrowserMatch ^Mozilla/4\.0[678] no-gzip
143 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
145 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
147 <IfModule mod_headers.c>
148 Header append Vary User-Agent env=!dont-vary
155 # ----------------------------------------------------------------------------------
156 # Some mod_deflate fun
157 # ----------------------------------------------------------------------------------
158 <IfModule mod_deflate.c>
159 SetOutputFilter DEFLATE
161 BrowserMatch ^Mozilla/4 gzip-only-text/html
162 BrowserMatch ^Mozilla/4\.0[678] no-gzip
163 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
165 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
167 <IfModule mod_headers.c>
168 Header append Vary User-Agent env=!dont-vary
174 # ----------------------------------------------------------------------------------
175 # Force SSL on the OPAC's "My Account" page
176 # ----------------------------------------------------------------------------------
177 <LocationMatch .*/myopac.xml>
181 <LocationMatch /opac/extras/>
182 # Force to en-US for now to satisfy bbags.xml
185 AddOutputFilter INCLUDES .xml
186 AddType application/xhtml+xml .xml
189 RewriteCond %{QUERY_STRING} locale=([^&]*)
190 RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
191 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
192 AddOutputFilter INCLUDES;XMLENT .html
195 # ----------------------------------------------------------------------------------
196 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
197 # ----------------------------------------------------------------------------------
198 RewriteCond %{HTTP:Accept-Language} ([a-z]{2}-[A-Z]{2})
199 RewriteRule ^/xul/ - [E=locale:%1]
200 RewriteRule ^/reports/ - [E=locale:%1]
202 # Default to en-US if we haven't matched a locale of the form xx-YY
203 RewriteCond %{HTTP:Accept-Language} !([a-z]{2}-[A-Z]{2})
204 RewriteRule ^/xul/ - [E=locale:en-US]
205 RewriteRule ^/reports/ - [E=locale:en-US]
207 # Default to en-US if we are just given en
208 RewriteCond %{ENV:locale} ^$ [OR]
209 RewriteCond %{ENV:locale} ^en$
210 RewriteRule . - [E=locale:en-US]
212 <LocationMatch /xul/.*\.x?html$>
214 XMLEntEscapeScript "no"
215 XMLEntStripComments "yes"
217 XMLEntStripDoctype "yes"
218 XMLEntContentType "text/html; charset=utf-8"
219 AddOutputFilter INCLUDES;XMLENT .xhtml
220 AddOutputFilter INCLUDES;XMLENT .html
225 <LocationMatch /xul/.*\.xul$>
227 XMLEntContentType "application/vnd.mozilla.xul+xml"
228 AddOutputFilter INCLUDES;XMLENT .xul
232 # ----------------------------------------------------------------------------------
233 # Self-serve password interface
234 # ----------------------------------------------------------------------------------
235 <Location /opac/password>
236 SetHandler perl-script
237 PerlHandler OpenILS::WWW::PasswordReset::password_reset
242 # Force clients to use HTTPS
243 RewriteCond %{HTTPS} !=on [NC]
244 RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
247 # ----------------------------------------------------------------------------------
249 # ----------------------------------------------------------------------------------
250 <Location /opac/extras/oisbn>
251 SetHandler perl-script
252 PerlHandler OpenILS::WWW::SuperCat::oisbn
257 <Location /opac/extras/supercat>
258 SetHandler perl-script
259 PerlHandler OpenILS::WWW::SuperCat::supercat
264 <Location /opac/extras/unapi>
265 SetHandler perl-script
266 PerlHandler OpenILS::WWW::SuperCat::unapi
271 <Location /opac/extras/feed/bookbag>
272 SetHandler perl-script
273 PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
278 <Location /opac/extras/opensearch>
279 SetHandler perl-script
280 PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
285 <Location /opac/extras/sru>
286 SetHandler perl-script
287 PerlHandler OpenILS::WWW::SuperCat::sru_search
292 <Location /opac/extras/sru_auth>
293 SetHandler perl-script
294 PerlHandler OpenILS::WWW::SuperCat::sru_auth_search
299 <Location /opac/extras/feed/freshmeat>
300 SetHandler perl-script
301 PerlHandler OpenILS::WWW::SuperCat::changes_feed
306 <Location /opac/extras/browse>
307 SetHandler perl-script
308 PerlHandler OpenILS::WWW::SuperCat::string_browse
313 <Location /opac/extras/startwith>
314 SetHandler perl-script
315 PerlHandler OpenILS::WWW::SuperCat::string_startwith
321 # ----------------------------------------------------------------------------------
322 # Module for displaying OpenSRF API documentation
323 # ----------------------------------------------------------------------------------
324 <Location /opac/extras/docgen.xsl>
325 AddOutputFilter INCLUDES .xsl
328 # ----------------------------------------------------------------------------------
329 # Module for processing staff-client offline scripts lives here
330 # ----------------------------------------------------------------------------------
331 <Directory "/openils/var/cgi-bin/offline">
332 AddHandler cgi-script .pl
339 # ----------------------------------------------------------------------------------
340 # XXX Note, it's important to explicitly set the JSON encoding style
341 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change
343 # ----------------------------------------------------------------------------------
344 # OpenSRF JSON legacy gateway
345 # ----------------------------------------------------------------------------------
347 SetHandler osrf_json_gateway_module
348 OSRFGatewayLegacyJSON "true"
351 # ----------------------------------------------------------------------------------
352 # New-style OpenSRF JSON gateway
353 # ----------------------------------------------------------------------------------
354 <Location /osrf-gateway-v1>
355 SetHandler osrf_json_gateway_module
356 OSRFGatewayLegacyJSON "false"
360 # ----------------------------------------------------------------------------------
361 # OpenSRF-over-HTTP translator
362 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
363 # ----------------------------------------------------------------------------------
364 <Location /osrf-http-translator>
365 SetHandler osrf_http_translator_module
369 # ----------------------------------------------------------------------------------
370 # The exporter lives here
371 # ----------------------------------------------------------------------------------
373 SetHandler perl-script
374 PerlSetVar OILSProxyTitle "Exporter Login"
375 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to export records"
376 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
377 PerlHandler OpenILS::WWW::Proxy OpenILS::WWW::Exporter
383 <Location /opac/extras/merge_template>
384 SetHandler perl-script
385 PerlSetVar OILSProxyTitle "Batch Update Login"
386 PerlSetVar OILSProxyDescription "Please log in to update records in batch"
387 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
388 PerlHandler OpenILS::WWW::Proxy OpenILS::WWW::TemplateBatchBibUpdate
394 <Location /opac/extras/circ>
395 SetHandler perl-script
396 PerlSetVar OILSProxyTitle "Circ Extras Login"
397 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to export records"
398 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
399 PerlHandler OpenILS::WWW::Proxy
405 # ----------------------------------------------------------------------------------
406 # Reporting output lives here
407 # ----------------------------------------------------------------------------------
408 <Location /reporter/>
409 SetHandler perl-script
410 PerlSetVar OILSProxyTitle "Report Login"
411 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to view this report"
412 PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
413 PerlHandler OpenILS::WWW::Proxy
419 # ----------------------------------------------------------------------------------
420 # Selfcheck interface
421 # ----------------------------------------------------------------------------------
422 <LocationMatch .*/selfcheck.xml>
423 SetHandler perl-script
424 PerlSetVar OILSProxyTitle "Self-check Login"
425 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to activate the self-check interface"
426 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
427 PerlHandler OpenILS::WWW::Proxy
434 # ----------------------------------------------------------------------------------
436 # ----------------------------------------------------------------------------------
437 <LocationMatch /reports>
439 AddOutputFilter INCLUDES;XMLENT .xhtml
442 <LocationMatch /reports/fm_IDL.xml>
443 IDLChunkStripPI "yes"
444 IDLChunkEscapeScript "no"
445 IDLChunkStripComments "yes"
446 IDLChunkStripDoctype "yes"
447 IDLChunkContentType "application/xml; charset=utf-8"
448 AddOutputFilter INCLUDES;IDLCHUNK .xml
451 # ----------------------------------------------------------------------------------
453 # ----------------------------------------------------------------------------------
455 SetHandler perl-script
456 PerlHandler OpenILS::WWW::EDI
462 # ----------------------------------------------------------------------------------
464 # ----------------------------------------------------------------------------------
466 SetHandler perl-script
467 PerlHandler OpenILS::WWW::XMLRPCGateway
473 # ----------------------------------------------------------------------------------
474 # Conify - next-generation Evergreen administration interface
475 # ----------------------------------------------------------------------------------
476 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
480 XMLEntEscapeScript "no"
481 XMLEntStripComments "no"
482 XMLEntContentType "text/html; charset=utf-8"
483 AddOutputFilter INCLUDES;XMLENT .html
485 SetHandler perl-script
486 PerlSetVar OILSProxyTitle "Dojo Admin Login"
487 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to administer Evergreen"
488 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
489 PerlHandler OpenILS::WWW::Proxy
495 # ----------------------------------------------------------------------------------
496 # Vandelay importers / exporters (your Web interface to bibliographic travel)
497 # ----------------------------------------------------------------------------------
498 RedirectMatch 301 ^/vandelay/vandelay.xml(.*)$ /vandelay/en-US/vandelay.xml$1
500 RewriteRule ^/vandelay/([a-z]{2}-[A-Z]{2})/(.*)$ /vandelay/$2 [E=locale:$1]
502 <LocationMatch /vandelay.*xml>
504 XMLEntEscapeScript "no"
505 XMLEntStripComments "yes"
506 XMLEntContentType "text/html; charset=utf-8"
507 XMLEntStripDoctype "yes"
508 AddOutputFilter INCLUDES;XMLENT .xml
509 SetHandler perl-script
510 PerlSetVar OILSProxyTitle "Vandelay Login"
511 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to import MARC records"
512 PerlSetVar OILSProxyPermissions "IMPORT_MARC"
513 PerlHandler OpenILS::WWW::Proxy
518 <Location /vandelay-upload>
519 SetHandler perl-script
520 PerlHandler OpenILS::WWW::Vandelay::spool_marc
525 # OpenURL 0.1 searching based on OpenSearch
526 RewriteMap openurl prg:/openils/bin/openurl_map.pl
527 RewriteCond %{QUERY_STRING} (^.*$)
528 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
532 # General Evergreen web template processor
534 SetHandler perl-script
535 PerlHandler OpenILS::WWW::EGWeb
540 PerlSetVar OILSWebBasePath "/eg"
541 PerlSetVar OILSWebWebDir "/openils/var/web"
542 PerlSetVar OILSWebDefaultTemplateExtension "tt2"
543 PerlSetVar OILSWebDebugTemplate "true"
545 # -------------------------------------------------------
546 # Media Prefix. In the 3rd example, the protocol (http) is enforced
547 #PerlSetVar OILSWebMediaPrefix "/media"
548 #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
549 #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
551 # Locale messages files
552 PerlAddVar OILSWebLocale "en"
553 PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en.po"
554 PerlAddVar OILSWebLocale "en_ca"
555 PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en_ca.po"
556 PerlAddVar OILSWebLocale "fr_ca"
557 PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.fr_ca.po"
559 # Templates will be loaded from the following paths in reverse order.
560 PerlAddVar OILSWebTemplatePath "/openils/var/templates"
561 PerlAddVar OILSWebTemplatePath "/openils/var/templates_localskin"
563 <IfModule mod_deflate.c>
564 SetOutputFilter DEFLATE
565 BrowserMatch ^Mozilla/4 gzip-only-text/html
566 BrowserMatch ^Mozilla/4\.0[678] no-gzip
567 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
568 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
569 <IfModule mod_headers.c>
570 Header append Cache-Control "public"
571 Header append Vary User-Agent env=!dont-vary
575 <LocationMatch ^/(images|css|js)/>
576 # should pick up the default expire time from eg.conf...
577 <IfModule mod_deflate.c>
578 SetOutputFilter DEFLATE
579 BrowserMatch ^Mozilla/4 gzip-only-text/html
580 BrowserMatch ^Mozilla/4\.0[678] no-gzip
581 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
582 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
583 <IfModule mod_headers.c>
584 Header append Cache-Control "public"
585 Header append Vary User-Agent env=!dont-vary
590 PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
591 # Expire the HTML quickly since we're loading dynamic data for each page
593 ExpiresByType text/html "access plus 5 seconds"
595 # For use with embedded Content Cafe content
596 #SetEnv OILS_CONTENT_CAFE_USER 123
597 #SetEnv OILS_CONTENT_CAFE_PASS 456
598 # Consider copying/moving other added content configs
599 # (e.g. NOVELIST) into here or to an outer container shared by
600 # both /opac and /eg/opac since some are used in both places
604 # Note: the template processor will decline handling anything it does not
605 # have an explicit configuration for, which means it will fall back to
606 # Apache to serve the file. However, in the interest of speed, go ahead
607 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
608 # Add more exemptions as needed.
609 <LocationMatch ^/eg/.*(\.js|\.css|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
613 # ----------------------------------------------------------------------------------
614 # Some mod_deflate logging setup
615 # ----------------------------------------------------------------------------------
616 <IfModule mod_deflate.c>
617 DeflateFilterNote Input instream
618 DeflateFilterNote Output outstream
619 DeflateFilterNote Ratio ratio
621 LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
622 CustomLog /var/log/apache2/deflate_log deflate
628 SetHandler perl-script
629 PerlHandler OpenILS::WWW::IDL2js
634 <IfModule mod_headers.c>
635 Header append Cache-Control "public"
638 <IfModule mod_deflate.c>
639 SetOutputFilter DEFLATE
640 BrowserMatch ^Mozilla/4 gzip-only-text/html
641 BrowserMatch ^Mozilla/4\.0[678] no-gzip
642 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
643 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
644 <IfModule mod_headers.c>
645 Header append Vary User-Agent env=!dont-vary