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
118 # Specify the initial script URL for Novelist (containing account credentials, etc.)
119 #SetEnv OILS_NOVELIST_URL
122 # Uncomment to force SSL any time a patron is logged in. This protects
123 # authentication tokens. Left commented out for backwards compat for now.
124 #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
127 # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js
128 #SetEnv OILS_OPAC_COMBINED_JS 1
133 # ----------------------------------------------------------------------------------
134 # Some mod_deflate fun
135 # ----------------------------------------------------------------------------------
136 <IfModule mod_deflate.c>
137 SetOutputFilter DEFLATE
139 BrowserMatch ^Mozilla/4 gzip-only-text/html
140 BrowserMatch ^Mozilla/4\.0[678] no-gzip
141 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
143 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
145 <IfModule mod_headers.c>
146 Header append Vary User-Agent env=!dont-vary
153 # ----------------------------------------------------------------------------------
154 # Some mod_deflate fun
155 # ----------------------------------------------------------------------------------
156 <IfModule mod_deflate.c>
157 SetOutputFilter DEFLATE
159 BrowserMatch ^Mozilla/4 gzip-only-text/html
160 BrowserMatch ^Mozilla/4\.0[678] no-gzip
161 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
163 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
165 <IfModule mod_headers.c>
166 Header append Vary User-Agent env=!dont-vary
173 # ----------------------------------------------------------------------------------
174 # Some mod_deflate fun
175 # ----------------------------------------------------------------------------------
176 <IfModule mod_deflate.c>
177 SetOutputFilter DEFLATE
179 BrowserMatch ^Mozilla/4 gzip-only-text/html
180 BrowserMatch ^Mozilla/4\.0[678] no-gzip
181 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
183 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
185 <IfModule mod_headers.c>
186 Header append Vary User-Agent env=!dont-vary
192 # ----------------------------------------------------------------------------------
193 # Force SSL on the OPAC's "My Account" page
194 # ----------------------------------------------------------------------------------
195 <LocationMatch .*/myopac.xml>
199 <LocationMatch /opac/extras/>
200 # Force to en-US for now to satisfy bbags.xml
203 AddOutputFilter INCLUDES .xml
204 AddType application/xhtml+xml .xml
207 RewriteCond %{QUERY_STRING} locale=([^&]*)
208 RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
209 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
210 AddOutputFilter INCLUDES;XMLENT .html
213 # ----------------------------------------------------------------------------------
214 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
215 # ----------------------------------------------------------------------------------
216 RewriteCond %{HTTP:Accept-Language} ([a-z]{2}-[A-Z]{2})
217 RewriteRule ^/xul/ - [E=locale:%1]
218 RewriteRule ^/reports/ - [E=locale:%1]
220 # Default to en-US if we haven't matched a locale of the form xx-YY
221 RewriteCond %{HTTP:Accept-Language} !([a-z]{2}-[A-Z]{2})
222 RewriteRule ^/xul/ - [E=locale:en-US]
223 RewriteRule ^/reports/ - [E=locale:en-US]
225 # Default to en-US if we are just given en
226 RewriteCond %{ENV:locale} ^$ [OR]
227 RewriteCond %{ENV:locale} ^en$
228 RewriteRule . - [E=locale:en-US]
230 <LocationMatch /xul/.*\.x?html$>
232 XMLEntEscapeScript "no"
233 XMLEntStripComments "yes"
235 XMLEntStripDoctype "yes"
236 XMLEntContentType "text/html; charset=utf-8"
237 AddOutputFilter INCLUDES;XMLENT .xhtml
238 AddOutputFilter INCLUDES;XMLENT .html
243 <LocationMatch /xul/.*\.xul$>
245 XMLEntContentType "application/vnd.mozilla.xul+xml"
246 AddOutputFilter INCLUDES;XMLENT .xul
250 # ----------------------------------------------------------------------------------
251 # Self-serve password interface
252 # ----------------------------------------------------------------------------------
253 <Location /opac/password>
254 SetHandler perl-script
255 PerlHandler OpenILS::WWW::PasswordReset::password_reset
260 # Force clients to use HTTPS
261 RewriteCond %{HTTPS} !=on [NC]
262 RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
265 # ----------------------------------------------------------------------------------
267 # ----------------------------------------------------------------------------------
268 <Location /opac/extras/oisbn>
269 SetHandler perl-script
270 PerlHandler OpenILS::WWW::SuperCat::oisbn
275 <Location /opac/extras/supercat>
276 SetHandler perl-script
277 PerlHandler OpenILS::WWW::SuperCat::supercat
282 <Location /opac/extras/unapi>
283 SetHandler perl-script
284 PerlHandler OpenILS::WWW::SuperCat::unapi
289 <Location /opac/extras/feed/bookbag>
290 SetHandler perl-script
291 PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
296 <Location /opac/extras/opensearch>
297 SetHandler perl-script
298 PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
303 <Location /opac/extras/sru>
304 SetHandler perl-script
305 PerlHandler OpenILS::WWW::SuperCat::sru_search
310 <Location /opac/extras/feed/freshmeat>
311 SetHandler perl-script
312 PerlHandler OpenILS::WWW::SuperCat::changes_feed
317 <Location /opac/extras/browse>
318 SetHandler perl-script
319 PerlHandler OpenILS::WWW::SuperCat::string_browse
324 <Location /opac/extras/startwith>
325 SetHandler perl-script
326 PerlHandler OpenILS::WWW::SuperCat::string_startwith
332 # ----------------------------------------------------------------------------------
333 # Module for displaying OpenSRF API documentation
334 # ----------------------------------------------------------------------------------
335 <Location /opac/extras/docgen.xsl>
336 AddOutputFilter INCLUDES .xsl
339 # ----------------------------------------------------------------------------------
340 # Module for processing staff-client offline scripts lives here
341 # ----------------------------------------------------------------------------------
342 <Directory "/openils/var/cgi-bin/offline">
343 AddHandler cgi-script .pl
350 # ----------------------------------------------------------------------------------
351 # XXX Note, it's important to explicitly set the JSON encoding style
352 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change
354 # ----------------------------------------------------------------------------------
355 # OpenSRF JSON legacy gateway
356 # ----------------------------------------------------------------------------------
358 SetHandler osrf_json_gateway_module
359 OSRFGatewayLegacyJSON "true"
362 # ----------------------------------------------------------------------------------
363 # New-style OpenSRF JSON gateway
364 # ----------------------------------------------------------------------------------
365 <Location /osrf-gateway-v1>
366 SetHandler osrf_json_gateway_module
367 OSRFGatewayLegacyJSON "false"
371 # ----------------------------------------------------------------------------------
372 # OpenSRF-over-HTTP translator
373 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
374 # ----------------------------------------------------------------------------------
375 <Location /osrf-http-translator>
376 SetHandler osrf_http_translator_module
380 # ----------------------------------------------------------------------------------
381 # The exporter lives here
382 # ----------------------------------------------------------------------------------
384 SetHandler perl-script
385 PerlSetVar OILSProxyTitle "Exporter Login"
386 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to export records"
387 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
388 PerlHandler OpenILS::WWW::Proxy OpenILS::WWW::Exporter
394 <Location /opac/extras/merge_template>
395 SetHandler perl-script
396 PerlSetVar OILSProxyTitle "Batch Update Login"
397 PerlSetVar OILSProxyDescription "Please log in to update records in batch"
398 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
399 PerlHandler OpenILS::WWW::Proxy OpenILS::WWW::TemplateBatchBibUpdate
405 <Location /opac/extras/circ>
406 SetHandler perl-script
407 PerlSetVar OILSProxyTitle "Circ Extras Login"
408 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to export records"
409 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
410 PerlHandler OpenILS::WWW::Proxy
416 # ----------------------------------------------------------------------------------
417 # Reporting output lives here
418 # ----------------------------------------------------------------------------------
419 <Location /reporter/>
420 SetHandler perl-script
421 PerlSetVar OILSProxyTitle "Report Login"
422 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to view this report"
423 PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
424 PerlHandler OpenILS::WWW::Proxy
430 # ----------------------------------------------------------------------------------
431 # Selfcheck interface
432 # ----------------------------------------------------------------------------------
433 <LocationMatch .*/selfcheck.xml>
434 SetHandler perl-script
435 PerlSetVar OILSProxyTitle "Self-check Login"
436 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to activate the self-check interface"
437 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
438 PerlHandler OpenILS::WWW::Proxy
445 # ----------------------------------------------------------------------------------
447 # ----------------------------------------------------------------------------------
448 <LocationMatch /reports>
450 AddOutputFilter INCLUDES;XMLENT .xhtml
453 <LocationMatch /reports/fm_IDL.xml>
454 IDLChunkStripPI "yes"
455 IDLChunkEscapeScript "no"
456 IDLChunkStripComments "yes"
457 IDLChunkStripDoctype "yes"
458 IDLChunkContentType "application/xml; charset=utf-8"
459 AddOutputFilter INCLUDES;IDLCHUNK .xml
462 # ----------------------------------------------------------------------------------
464 # ----------------------------------------------------------------------------------
466 SetHandler perl-script
467 PerlHandler OpenILS::WWW::EDI
473 # ----------------------------------------------------------------------------------
475 # ----------------------------------------------------------------------------------
477 SetHandler perl-script
478 PerlHandler OpenILS::WWW::XMLRPCGateway
484 # ----------------------------------------------------------------------------------
485 # Conify - next-generation Evergreen administration interface
486 # ----------------------------------------------------------------------------------
487 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
491 XMLEntEscapeScript "no"
492 XMLEntStripComments "no"
493 XMLEntContentType "text/html; charset=utf-8"
494 AddOutputFilter INCLUDES;XMLENT .html
496 SetHandler perl-script
497 PerlSetVar OILSProxyTitle "Dojo Admin Login"
498 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to administer Evergreen"
499 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
500 PerlHandler OpenILS::WWW::Proxy
506 # ----------------------------------------------------------------------------------
507 # Vandelay importers / exporters (your Web interface to bibliographic travel)
508 # ----------------------------------------------------------------------------------
509 RedirectMatch 301 ^/vandelay/vandelay.xml(.*)$ /vandelay/en-US/vandelay.xml$1
511 RewriteRule ^/vandelay/([a-z]{2}-[A-Z]{2})/(.*)$ /vandelay/$2 [E=locale:$1]
513 <LocationMatch /vandelay.*xml>
515 XMLEntEscapeScript "no"
516 XMLEntStripComments "yes"
517 XMLEntContentType "text/html; charset=utf-8"
518 XMLEntStripDoctype "yes"
519 AddOutputFilter INCLUDES;XMLENT .xml
520 SetHandler perl-script
521 PerlSetVar OILSProxyTitle "Vandelay Login"
522 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to import MARC records"
523 PerlSetVar OILSProxyPermissions "IMPORT_MARC"
524 PerlHandler OpenILS::WWW::Proxy
529 <Location /vandelay-upload>
530 SetHandler perl-script
531 PerlHandler OpenILS::WWW::Vandelay::spool_marc
536 # OpenURL 0.1 searching based on OpenSearch
537 RewriteMap openurl prg:/openils/bin/openurl_map.pl
538 RewriteCond %{QUERY_STRING} (^.*$)
539 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
543 # General Evergreen web template processor
545 SetHandler perl-script
546 PerlHandler OpenILS::WWW::EGWeb
550 <IfModule mod_deflate.c>
551 SetOutputFilter DEFLATE
552 BrowserMatch ^Mozilla/4 gzip-only-text/html
553 BrowserMatch ^Mozilla/4\.0[678] no-gzip
554 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
555 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
556 <IfModule mod_headers.c>
557 Header append Vary User-Agent env=!dont-vary
562 PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
563 # Disable caching for development..
564 <IfModule mod_headers.c>
565 # Header set Expires "Thu, 19 Nov 1981 08:52:00 GM"
566 # Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
567 # Header set Pragma "no-cache"
571 # Note: the template processor will decline handling anything it does not
572 # have an explicit configuration for, which means it will fall back to
573 # Apache to serve the file. However, in the interest of speed, go ahead
574 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
575 # Add more exemptions as needed.
576 <LocationMatch ^/eg/.*(\.js|\.css|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
580 # ----------------------------------------------------------------------------------
581 # Some mod_deflate logging setup
582 # ----------------------------------------------------------------------------------
583 <IfModule mod_deflate.c>
584 DeflateFilterNote Input instream
585 DeflateFilterNote Output outstream
586 DeflateFilterNote Ratio ratio
588 LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
589 CustomLog /var/log/apache2/deflate_log deflate
595 SetHandler perl-script
596 PerlHandler OpenILS::WWW::IDL2js
601 <IfModule mod_headers.c>
602 Header append Cache-Control "public"
605 <IfModule mod_deflate.c>
606 SetOutputFilter DEFLATE
607 BrowserMatch ^Mozilla/4 gzip-only-text/html
608 BrowserMatch ^Mozilla/4\.0[678] no-gzip
609 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
610 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
611 <IfModule mod_headers.c>
612 Header append Vary User-Agent env=!dont-vary