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 <Location /vandelay-upload>
496 SetHandler perl-script
497 PerlHandler OpenILS::WWW::Vandelay::spool_marc
502 # OpenURL 0.1 searching based on OpenSearch
503 RewriteMap openurl prg:/openils/bin/openurl_map.pl
504 RewriteCond %{QUERY_STRING} (^.*$)
505 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
509 # General Evergreen web template processor
511 SetHandler perl-script
512 PerlHandler OpenILS::WWW::EGWeb
517 PerlSetVar OILSWebBasePath "/eg"
518 PerlSetVar OILSWebWebDir "/openils/var/web"
519 PerlSetVar OILSWebDefaultTemplateExtension "tt2"
521 # Enable Template-Toolkit error debugging messages (apache error log)
522 PerlSetVar OILSWebDebugTemplate "true"
524 # -------------------------------------------------------
525 # Media Prefix. In the 3rd example, the protocol (http) is enforced
526 #PerlSetVar OILSWebMediaPrefix "/media"
527 #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
528 #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
530 # Locale messages files
531 #PerlAddVar OILSWebLocale "en"
532 #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en.po"
533 #PerlAddVar OILSWebLocale "en_ca"
534 #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en_ca.po"
535 #PerlAddVar OILSWebLocale "fr_ca"
536 #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.fr_ca.po"
538 # Templates will be loaded from the following paths in reverse order.
539 PerlAddVar OILSWebTemplatePath "/openils/var/templates"
540 #PerlAddVar OILSWebTemplatePath "/openils/var/templates_localskin"
542 <IfModule mod_deflate.c>
543 SetOutputFilter DEFLATE
544 BrowserMatch ^Mozilla/4 gzip-only-text/html
545 BrowserMatch ^Mozilla/4\.0[678] no-gzip
546 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
547 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
548 <IfModule mod_headers.c>
549 Header append Cache-Control "public"
550 Header append Vary User-Agent env=!dont-vary
554 <LocationMatch ^/(images|css|js)/>
555 # should pick up the default expire time from eg.conf...
556 <IfModule mod_deflate.c>
557 SetOutputFilter DEFLATE
558 BrowserMatch ^Mozilla/4 gzip-only-text/html
559 BrowserMatch ^Mozilla/4\.0[678] no-gzip
560 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
561 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
562 <IfModule mod_headers.c>
563 Header append Cache-Control "public"
564 Header append Vary User-Agent env=!dont-vary
569 PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
570 # Expire the HTML quickly since we're loading dynamic data for each page
572 ExpiresByType text/html "access plus 5 seconds"
574 # For use with embedded Content Cafe content
575 #SetEnv OILS_CONTENT_CAFE_USER 123
576 #SetEnv OILS_CONTENT_CAFE_PASS 456
577 # Consider copying/moving other added content configs
578 # (e.g. NOVELIST) into here or to an outer container shared by
579 # both /opac and /eg/opac since some are used in both places
583 # Note: the template processor will decline handling anything it does not
584 # have an explicit configuration for, which means it will fall back to
585 # Apache to serve the file. However, in the interest of speed, go ahead
586 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
587 # Add more exemptions as needed.
588 <LocationMatch ^/eg/.*(\.js|\.css|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
592 # ----------------------------------------------------------------------------------
593 # Some mod_deflate logging setup
594 # ----------------------------------------------------------------------------------
595 <IfModule mod_deflate.c>
596 DeflateFilterNote Input instream
597 DeflateFilterNote Output outstream
598 DeflateFilterNote Ratio ratio
600 LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
601 CustomLog /var/log/apache2/deflate_log deflate
607 SetHandler perl-script
608 PerlHandler OpenILS::WWW::IDL2js
613 <IfModule mod_headers.c>
614 Header append Cache-Control "public"
617 <IfModule mod_deflate.c>
618 SetOutputFilter DEFLATE
619 BrowserMatch ^Mozilla/4 gzip-only-text/html
620 BrowserMatch ^Mozilla/4\.0[678] no-gzip
621 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
622 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
623 <IfModule mod_headers.c>
624 Header append Vary User-Agent env=!dont-vary
629 # Uncomment the following to force SSL for everything. Note that this defeats caching
630 # and you will suffer a performance hit.
631 #RewriteCond %{HTTPS} off
632 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]