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"
27 # ----------------------------------------------------------------------------------
28 # Assign a default locale to the accessible OPAC
29 # ----------------------------------------------------------------------------------
30 RedirectMatch 301 ^/opac/extras/slimpac/start.html$ /opac/en-US/extras/slimpac/start.html
31 RedirectMatch 301 ^/opac/extras/slimpac/advanced.html$ /opac/en-US/extras/slimpac/advanced.html
33 # ----------------------------------------------------------------------------------
34 # Configure the gateway
35 # ----------------------------------------------------------------------------------
36 OSRFGatewayConfig /openils/conf/opensrf_core.xml
37 # Translator memcache server. Default is localhost
38 # OSRFTranslatorCacheServer 127.0.0.1:11211
41 # ----------------------------------------------------------------------------------
42 # Added content plugin
43 # ----------------------------------------------------------------------------------
44 <Location /opac/extras/ac/>
45 SetHandler perl-script
46 PerlHandler OpenILS::WWW::AddedContent
52 # ----------------------------------------------------------------------------------
53 # Replace broken cover images with a transparent GIF by default
54 # ----------------------------------------------------------------------------------
56 RewriteRule ^/opac/extras/ac/jacket/(small|medium|large)/$ \
57 /opac/images/blank.png [P,L]
59 # ----------------------------------------------------------------------------------
60 # Add the row ID (RID) and date so we can make unAPI happy
61 # ----------------------------------------------------------------------------------
62 RewriteCond %{QUERY_STRING} (^r|&r)=(\d+)
63 RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}]
65 # ----------------------------------------------------------------------------------
66 # Pull the locale from the URL
67 # ----------------------------------------------------------------------------------
68 RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
69 RewriteRule . - [E=locale:%1]
71 # ----------------------------------------------------------------------------------
73 # ----------------------------------------------------------------------------------
74 <LocationMatch /opac/>
75 AddType application/xhtml+xml .xml
77 # - configure mod_xmlent
79 XMLEntEscapeScript "no"
80 XMLEntStripComments "yes"
81 XMLEntContentType "text/html; charset=utf-8"
82 # forces quirks mode which we want for now
83 XMLEntStripDoctype "yes"
85 # - set up the include handlers
87 AddOutputFilter INCLUDES .xsl
88 AddOutputFilter INCLUDES;XMLENT .xml
90 SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
92 # This gives you the option to configure a different host to serve OPAC images from
93 # Specify the hostname (without protocol) and path to the images. Protocol will
94 # be determined at runtime
95 #SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=static.example.org/opac/
97 # In addition to loading images from a static host, you can also load CSS and/or
98 # Javascript from a static host or hosts. Protocol will be determined at runtime
99 # and/or by configuration options immediately following.
100 #SetEnvIf Request_URI ".*" OILS_OPAC_CSS_HOST=static.example.org/opac/
101 #SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=static.example.org/opac/
103 # If you are not able to serve static content via https and
104 # wish to force http:// (and are comfortable with mixed-content
105 # warnings in client browsers), set this:
106 #SetEnvIf Request_URI ".*" OILS_OPAC_STATIC_PROTOCOL=http
108 # If you would prefer to fall back to your non-static servers for
109 # https pages, avoiding mixed-content warnings in client browsers
110 # and are willing to accept some increased server load, set this:
111 #SetEnvIf Request_URI ".*" OILS_OPAC_BYPASS_STATIC_FOR_HTTPS=yes
113 # Specify a ChiliFresh account to integrate their services with the OPAC
114 #SetEnv OILS_CHILIFRESH_ACCOUNT
115 #SetEnv OILS_CHILIFRESH_PROFILE
116 #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
117 #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
119 # Specify the initial script URL for Novelist (containing account credentials, etc.)
120 #SetEnv OILS_NOVELIST_URL
123 # Uncomment to force SSL any time a patron is logged in. This protects
124 # authentication tokens. Left commented out for backwards compat for now.
125 #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
128 # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js
129 #SetEnv OILS_OPAC_COMBINED_JS 1
134 # ----------------------------------------------------------------------------------
135 # Some mod_deflate fun
136 # ----------------------------------------------------------------------------------
137 <IfModule mod_deflate.c>
138 SetOutputFilter DEFLATE
140 BrowserMatch ^Mozilla/4 gzip-only-text/html
141 BrowserMatch ^Mozilla/4\.0[678] no-gzip
142 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
144 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
146 <IfModule mod_headers.c>
147 Header append Vary User-Agent env=!dont-vary
154 # ----------------------------------------------------------------------------------
155 # Some mod_deflate fun
156 # ----------------------------------------------------------------------------------
157 <IfModule mod_deflate.c>
158 SetOutputFilter DEFLATE
160 BrowserMatch ^Mozilla/4 gzip-only-text/html
161 BrowserMatch ^Mozilla/4\.0[678] no-gzip
162 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
164 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
166 <IfModule mod_headers.c>
167 Header append Vary User-Agent env=!dont-vary
173 # ----------------------------------------------------------------------------------
174 # Force SSL on the OPAC's "My Account" page
175 # ----------------------------------------------------------------------------------
176 <LocationMatch .*/myopac.xml>
180 <LocationMatch /opac/extras/>
181 # Force to en-US for now to satisfy bbags.xml
184 AddOutputFilter INCLUDES .xml
185 AddType application/xhtml+xml .xml
188 RewriteCond %{QUERY_STRING} locale=([^&]*)
189 RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
190 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
191 AddOutputFilter INCLUDES;XMLENT .html
194 # ----------------------------------------------------------------------------------
195 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
196 # ----------------------------------------------------------------------------------
197 RewriteCond %{HTTP:Accept-Language} ([a-z]{2}-[A-Z]{2})
198 RewriteRule ^/xul/ - [E=locale:%1]
199 RewriteRule ^/reports/ - [E=locale:%1]
201 # Default to en-US if we haven't matched a locale of the form xx-YY
202 RewriteCond %{HTTP:Accept-Language} !([a-z]{2}-[A-Z]{2})
203 RewriteRule ^/xul/ - [E=locale:en-US]
204 RewriteRule ^/reports/ - [E=locale:en-US]
206 # Default to en-US if we are just given en
207 RewriteCond %{ENV:locale} ^$ [OR]
208 RewriteCond %{ENV:locale} ^en$
209 RewriteRule . - [E=locale:en-US]
211 <LocationMatch /xul/.*\.x?html$>
213 XMLEntEscapeScript "no"
214 XMLEntStripComments "yes"
216 XMLEntStripDoctype "yes"
217 XMLEntContentType "text/html; charset=utf-8"
218 AddOutputFilter INCLUDES;XMLENT .xhtml
219 AddOutputFilter INCLUDES;XMLENT .html
224 <LocationMatch /xul/.*\.xul$>
226 XMLEntContentType "application/vnd.mozilla.xul+xml"
227 AddOutputFilter INCLUDES;XMLENT .xul
231 # ----------------------------------------------------------------------------------
232 # Self-serve password interface
233 # ----------------------------------------------------------------------------------
234 <Location /opac/password>
235 SetHandler perl-script
236 PerlHandler OpenILS::WWW::PasswordReset::password_reset
241 # Force clients to use HTTPS
242 RewriteCond %{HTTPS} !=on [NC]
243 RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
246 # ----------------------------------------------------------------------------------
248 # ----------------------------------------------------------------------------------
249 <Location /opac/extras/oisbn>
250 SetHandler perl-script
251 PerlHandler OpenILS::WWW::SuperCat::oisbn
256 <Location /opac/extras/supercat>
257 SetHandler perl-script
258 PerlHandler OpenILS::WWW::SuperCat::supercat
263 <Location /opac/extras/unapi>
264 SetHandler perl-script
265 PerlHandler OpenILS::WWW::SuperCat::unapi
270 <Location /opac/extras/feed/bookbag>
271 SetHandler perl-script
272 PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
277 <Location /opac/extras/opensearch>
278 SetHandler perl-script
279 PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
284 <Location /opac/extras/sru>
285 SetHandler perl-script
286 PerlHandler OpenILS::WWW::SuperCat::sru_search
291 <Location /opac/extras/sru_auth>
292 SetHandler perl-script
293 PerlHandler OpenILS::WWW::SuperCat::sru_auth_search
298 <Location /opac/extras/feed/freshmeat>
299 SetHandler perl-script
300 PerlHandler OpenILS::WWW::SuperCat::changes_feed
305 <Location /opac/extras/browse>
306 SetHandler perl-script
307 PerlHandler OpenILS::WWW::SuperCat::string_browse
312 <Location /opac/extras/startwith>
313 SetHandler perl-script
314 PerlHandler OpenILS::WWW::SuperCat::string_startwith
320 # ----------------------------------------------------------------------------------
321 # Module for displaying OpenSRF API documentation
322 # ----------------------------------------------------------------------------------
323 <Location /opac/extras/docgen.xsl>
324 AddOutputFilter INCLUDES .xsl
327 # ----------------------------------------------------------------------------------
328 # Module for processing staff-client offline scripts lives here
329 # ----------------------------------------------------------------------------------
330 <Directory "/openils/var/cgi-bin/offline">
331 AddHandler cgi-script .pl
338 # ----------------------------------------------------------------------------------
339 # XXX Note, it's important to explicitly set the JSON encoding style
340 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change
342 # ----------------------------------------------------------------------------------
343 # OpenSRF JSON legacy gateway
344 # ----------------------------------------------------------------------------------
346 SetHandler osrf_json_gateway_module
347 OSRFGatewayLegacyJSON "true"
350 # ----------------------------------------------------------------------------------
351 # New-style OpenSRF JSON gateway
352 # ----------------------------------------------------------------------------------
353 <Location /osrf-gateway-v1>
354 SetHandler osrf_json_gateway_module
355 OSRFGatewayLegacyJSON "false"
359 # ----------------------------------------------------------------------------------
360 # OpenSRF-over-HTTP translator
361 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
362 # ----------------------------------------------------------------------------------
363 <Location /osrf-http-translator>
364 SetHandler osrf_http_translator_module
368 # ----------------------------------------------------------------------------------
369 # The exporter lives here
370 # ----------------------------------------------------------------------------------
372 SetHandler perl-script
373 PerlSetVar OILSProxyTitle "Exporter Login"
374 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to export records"
375 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
376 PerlHandler OpenILS::WWW::Proxy OpenILS::WWW::Exporter
382 <Location /opac/extras/merge_template>
383 SetHandler perl-script
384 PerlSetVar OILSProxyTitle "Batch Update Login"
385 PerlSetVar OILSProxyDescription "Please log in to update records in batch"
386 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
387 PerlHandler OpenILS::WWW::Proxy OpenILS::WWW::TemplateBatchBibUpdate
393 <Location /opac/extras/circ>
394 SetHandler perl-script
395 PerlSetVar OILSProxyTitle "Circ Extras Login"
396 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to export records"
397 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
398 PerlHandler OpenILS::WWW::Proxy
404 # ----------------------------------------------------------------------------------
405 # Reporting output lives here
406 # ----------------------------------------------------------------------------------
407 <Location /reporter/>
408 SetHandler perl-script
409 PerlSetVar OILSProxyTitle "Report Login"
410 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to view this report"
411 PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
412 PerlHandler OpenILS::WWW::Proxy
418 # ----------------------------------------------------------------------------------
419 # Selfcheck interface
420 # ----------------------------------------------------------------------------------
421 <LocationMatch .*/selfcheck.xml>
422 SetHandler perl-script
423 PerlSetVar OILSProxyTitle "Self-check Login"
424 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to activate the self-check interface"
425 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
426 PerlHandler OpenILS::WWW::Proxy
433 # ----------------------------------------------------------------------------------
435 # ----------------------------------------------------------------------------------
436 <LocationMatch /reports>
438 AddOutputFilter INCLUDES;XMLENT .xhtml
441 <LocationMatch /reports/fm_IDL.xml>
442 IDLChunkStripPI "yes"
443 IDLChunkEscapeScript "no"
444 IDLChunkStripComments "yes"
445 IDLChunkStripDoctype "yes"
446 IDLChunkContentType "application/xml; charset=utf-8"
447 AddOutputFilter INCLUDES;IDLCHUNK .xml
450 # ----------------------------------------------------------------------------------
452 # ----------------------------------------------------------------------------------
454 SetHandler perl-script
455 PerlHandler OpenILS::WWW::EDI
461 # ----------------------------------------------------------------------------------
463 # ----------------------------------------------------------------------------------
465 SetHandler perl-script
466 PerlHandler OpenILS::WWW::XMLRPCGateway
472 # ----------------------------------------------------------------------------------
473 # Conify - next-generation Evergreen administration interface
474 # ----------------------------------------------------------------------------------
475 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
479 XMLEntEscapeScript "no"
480 XMLEntStripComments "no"
481 XMLEntContentType "text/html; charset=utf-8"
482 AddOutputFilter INCLUDES;XMLENT .html
484 SetHandler perl-script
485 PerlSetVar OILSProxyTitle "Dojo Admin Login"
486 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to administer Evergreen"
487 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
488 PerlHandler OpenILS::WWW::Proxy
494 # ----------------------------------------------------------------------------------
495 # Vandelay importers / exporters (your Web interface to bibliographic travel)
496 # ----------------------------------------------------------------------------------
497 RedirectMatch 301 ^/vandelay/vandelay.xml(.*)$ /vandelay/en-US/vandelay.xml$1
499 RewriteRule ^/vandelay/([a-z]{2}-[A-Z]{2})/(.*)$ /vandelay/$2 [E=locale:$1]
501 <LocationMatch /vandelay.*xml>
503 XMLEntEscapeScript "no"
504 XMLEntStripComments "yes"
505 XMLEntContentType "text/html; charset=utf-8"
506 XMLEntStripDoctype "yes"
507 AddOutputFilter INCLUDES;XMLENT .xml
508 SetHandler perl-script
509 PerlSetVar OILSProxyTitle "Vandelay Login"
510 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to import MARC records"
511 PerlSetVar OILSProxyPermissions "IMPORT_MARC"
512 PerlHandler OpenILS::WWW::Proxy
517 <Location /vandelay-upload>
518 SetHandler perl-script
519 PerlHandler OpenILS::WWW::Vandelay::spool_marc
524 # OpenURL 0.1 searching based on OpenSearch
525 RewriteMap openurl prg:/openils/bin/openurl_map.pl
526 RewriteCond %{QUERY_STRING} (^.*$)
527 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
531 # General Evergreen web template processor
533 SetHandler perl-script
534 PerlHandler OpenILS::WWW::EGWeb
538 <IfModule mod_deflate.c>
539 SetOutputFilter DEFLATE
540 BrowserMatch ^Mozilla/4 gzip-only-text/html
541 BrowserMatch ^Mozilla/4\.0[678] no-gzip
542 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
543 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
544 <IfModule mod_headers.c>
545 Header append Cache-Control "public"
546 Header append Vary User-Agent env=!dont-vary
550 <LocationMatch ^/(images|css|js)/>
551 # should pick up the default expire time from eg.conf...
552 <IfModule mod_deflate.c>
553 SetOutputFilter DEFLATE
554 BrowserMatch ^Mozilla/4 gzip-only-text/html
555 BrowserMatch ^Mozilla/4\.0[678] no-gzip
556 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
557 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
558 <IfModule mod_headers.c>
559 Header append Cache-Control "public"
560 Header append Vary User-Agent env=!dont-vary
565 PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
566 # Expire the HTML quickly since we're loading dynamic data for each page
568 ExpiresByType text/html "access plus 5 seconds"
572 # Note: the template processor will decline handling anything it does not
573 # have an explicit configuration for, which means it will fall back to
574 # Apache to serve the file. However, in the interest of speed, go ahead
575 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
576 # Add more exemptions as needed.
577 <LocationMatch ^/eg/.*(\.js|\.css|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
581 # ----------------------------------------------------------------------------------
582 # Some mod_deflate logging setup
583 # ----------------------------------------------------------------------------------
584 <IfModule mod_deflate.c>
585 DeflateFilterNote Input instream
586 DeflateFilterNote Output outstream
587 DeflateFilterNote Ratio ratio
589 LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
590 CustomLog /var/log/apache2/deflate_log deflate
596 SetHandler perl-script
597 PerlHandler OpenILS::WWW::IDL2js
602 <IfModule mod_headers.c>
603 Header append Cache-Control "public"
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 Vary User-Agent env=!dont-vary