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 # ----------------------------------------------------------------------------------
63 RewriteCond %{QUERY_STRING} (^r|&r)=(\d+)
64 RewriteRule - - [E=OILS_OPAC_RID:%2]
65 RewriteRule - - [E=OILS_TIME_YEAR:%{TIME_YEAR}] [L]
67 # ----------------------------------------------------------------------------------
68 # Pull the locale from the URL
69 # ----------------------------------------------------------------------------------
71 RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
72 RewriteRule - - [E=locale:%1] [L]
74 # ----------------------------------------------------------------------------------
76 # ----------------------------------------------------------------------------------
77 <LocationMatch /opac/>
78 AddType application/xhtml+xml .xml
80 # - configure mod_xmlent
82 XMLEntEscapeScript "no"
83 XMLEntStripComments "yes"
84 XMLEntContentType "text/html; charset=utf-8"
85 # forces quirks mode which we want for now
86 XMLEntStripDoctype "yes"
88 # - set up the include handlers
90 AddOutputFilter INCLUDES .xsl
91 AddOutputFilter INCLUDES;XMLENT .xml
93 SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
95 # This gives you the option to configure a different host to serve OPAC images from
96 # Specify the hostname (without protocol) and path to the images. Protocol will
97 # be determined at runtime
98 #SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=static.example.org/opac/
100 # In addition to loading images from a static host, you can also load CSS and/or
101 # Javascript from a static host or hosts. Protocol will be determined at runtime
102 # and/or by configuration options immediately following.
103 #SetEnvIf Request_URI ".*" OILS_OPAC_CSS_HOST=static.example.org/opac/
104 #SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=static.example.org/opac/
106 # If you are not able to serve static content via https and
107 # wish to force http:// (and are comfortable with mixed-content
108 # warnings in client browsers), set this:
109 #SetEnvIf Request_URI ".*" OILS_OPAC_STATIC_PROTOCOL=http
111 # If you would prefer to fall back to your non-static servers for
112 # https pages, avoiding mixed-content warnings in client browsers
113 # and are willing to accept some increased server load, set this:
114 #SetEnvIf Request_URI ".*" OILS_OPAC_BYPASS_STATIC_FOR_HTTPS=yes
116 # Specify a ChiliFresh account to integrate their services with the OPAC
117 #SetEnv OILS_CHILIFRESH_ACCOUNT
118 #SetEnv OILS_CHILIFRESH_PROFILE
119 #SetEnv OILS_CHILIFRESH_URL http://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
132 # ----------------------------------------------------------------------------------
133 # Some mod_deflate fun
134 # ----------------------------------------------------------------------------------
135 <IfModule mod_deflate.c>
136 SetOutputFilter DEFLATE
138 BrowserMatch ^Mozilla/4 gzip-only-text/html
139 BrowserMatch ^Mozilla/4\.0[678] no-gzip
140 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
142 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
144 <IfModule mod_headers.c>
145 Header append Vary User-Agent env=!dont-vary
152 # ----------------------------------------------------------------------------------
153 # Some mod_deflate fun
154 # ----------------------------------------------------------------------------------
155 <IfModule mod_deflate.c>
156 SetOutputFilter DEFLATE
158 BrowserMatch ^Mozilla/4 gzip-only-text/html
159 BrowserMatch ^Mozilla/4\.0[678] no-gzip
160 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
162 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
164 <IfModule mod_headers.c>
165 Header append Vary User-Agent env=!dont-vary
172 # ----------------------------------------------------------------------------------
173 # Some mod_deflate fun
174 # ----------------------------------------------------------------------------------
175 <IfModule mod_deflate.c>
176 SetOutputFilter DEFLATE
178 BrowserMatch ^Mozilla/4 gzip-only-text/html
179 BrowserMatch ^Mozilla/4\.0[678] no-gzip
180 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
182 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
184 <IfModule mod_headers.c>
185 Header append Vary User-Agent env=!dont-vary
191 # ----------------------------------------------------------------------------------
192 # Force SSL on the OPAC's "My Account" page
193 # ----------------------------------------------------------------------------------
194 <LocationMatch .*/myopac.xml>
198 <LocationMatch /opac/extras/>
199 # Force to en-US for now to satisfy bbags.xml
202 AddOutputFilter INCLUDES .xml
203 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 # ----------------------------------------------------------------------------------
217 RewriteCond %{HTTP:Accept-Language} ([a-z]{2}-[A-Z]{2})
218 RewriteRule ^/xul/ - [E=locale:%1]
219 RewriteRule ^/reports/ - [E=locale:%1] [L]
221 # Default to en-US if we haven't matched a locale of the form xx-YY
223 RewriteCond %{HTTP:Accept-Language} !([a-z]{2}-[A-Z]{2})
224 RewriteRule ^/xul/ - [E=locale:en-US]
225 RewriteRule ^/reports/ - [E=locale:en-US] [L]
227 # 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] [L]
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
246 <LocationMatch /xul/.*\.xul$>
248 XMLEntContentType "application/vnd.mozilla.xul+xml"
249 AddOutputFilter INCLUDES;XMLENT .xul
253 # ----------------------------------------------------------------------------------
254 # Self-serve password interface
255 # ----------------------------------------------------------------------------------
256 <Location /opac/password>
257 SetHandler perl-script
258 PerlHandler OpenILS::WWW::PasswordReset::password_reset
263 # Force clients to use HTTPS
265 RewriteCond %{HTTPS} !=on [NC]
266 RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
269 # ----------------------------------------------------------------------------------
271 # ----------------------------------------------------------------------------------
272 <Location /opac/extras/oisbn>
273 SetHandler perl-script
274 PerlHandler OpenILS::WWW::SuperCat::oisbn
279 <Location /opac/extras/supercat>
280 SetHandler perl-script
281 PerlHandler OpenILS::WWW::SuperCat::supercat
286 <Location /opac/extras/unapi>
287 SetHandler perl-script
288 PerlHandler OpenILS::WWW::SuperCat::unapi
293 <Location /opac/extras/feed/bookbag>
294 SetHandler perl-script
295 PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
300 <Location /opac/extras/opensearch>
301 SetHandler perl-script
302 PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
307 <Location /opac/extras/sru>
308 SetHandler perl-script
309 PerlHandler OpenILS::WWW::SuperCat::sru_search
314 <Location /opac/extras/feed/freshmeat>
315 SetHandler perl-script
316 PerlHandler OpenILS::WWW::SuperCat::changes_feed
321 <Location /opac/extras/browse>
322 SetHandler perl-script
323 PerlHandler OpenILS::WWW::SuperCat::string_browse
328 <Location /opac/extras/startwith>
329 SetHandler perl-script
330 PerlHandler OpenILS::WWW::SuperCat::string_startwith
336 # ----------------------------------------------------------------------------------
337 # Module for displaying OpenSRF API documentation
338 # ----------------------------------------------------------------------------------
339 <Location /opac/extras/docgen.xsl>
340 AddOutputFilter INCLUDES .xsl
343 # ----------------------------------------------------------------------------------
344 # Module for processing staff-client offline scripts lives here
345 # ----------------------------------------------------------------------------------
346 <Directory "/openils/var/cgi-bin/offline">
347 AddHandler cgi-script .pl
354 # ----------------------------------------------------------------------------------
355 # XXX Note, it's important to explicitly set the JSON encoding style
356 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change
358 # ----------------------------------------------------------------------------------
359 # OpenSRF JSON legacy gateway
360 # ----------------------------------------------------------------------------------
362 SetHandler osrf_json_gateway_module
363 OSRFGatewayLegacyJSON "true"
366 # ----------------------------------------------------------------------------------
367 # New-style OpenSRF JSON gateway
368 # ----------------------------------------------------------------------------------
369 <Location /osrf-gateway-v1>
370 SetHandler osrf_json_gateway_module
371 OSRFGatewayLegacyJSON "false"
375 # ----------------------------------------------------------------------------------
376 # OpenSRF-over-HTTP translator
377 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
378 # ----------------------------------------------------------------------------------
379 <Location /osrf-http-translator>
380 SetHandler osrf_http_translator_module
384 # ----------------------------------------------------------------------------------
385 # The exporter lives here
386 # ----------------------------------------------------------------------------------
388 SetHandler perl-script
389 PerlSetVar OILSProxyTitle "Exporter Login"
390 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to export records"
391 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
392 PerlHandler OpenILS::WWW::Proxy OpenILS::WWW::Exporter
398 # ----------------------------------------------------------------------------------
399 # Reporting output lives here
400 # ----------------------------------------------------------------------------------
401 <Location /reporter/>
402 SetHandler perl-script
403 PerlSetVar OILSProxyTitle "Report Login"
404 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to view this report"
405 PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
406 PerlHandler OpenILS::WWW::Proxy
412 # ----------------------------------------------------------------------------------
413 # Selfcheck interface
414 # ----------------------------------------------------------------------------------
415 <LocationMatch .*/selfcheck.xml>
416 SetHandler perl-script
417 PerlSetVar OILSProxyTitle "Self-check Login"
418 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to activate the self-check interface"
419 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
420 PerlHandler OpenILS::WWW::Proxy
427 # ----------------------------------------------------------------------------------
429 # ----------------------------------------------------------------------------------
430 <LocationMatch /reports>
432 AddOutputFilter INCLUDES;XMLENT .xhtml
435 <LocationMatch /reports/fm_IDL.xml>
436 IDLChunkStripPI "yes"
437 IDLChunkEscapeScript "no"
438 IDLChunkStripComments "yes"
439 IDLChunkStripDoctype "yes"
440 IDLChunkContentType "application/xml; charset=utf-8"
441 AddOutputFilter INCLUDES;IDLCHUNK .xml
444 # ----------------------------------------------------------------------------------
446 # ----------------------------------------------------------------------------------
448 SetHandler perl-script
449 PerlHandler OpenILS::WWW::EDI
455 # ----------------------------------------------------------------------------------
457 # ----------------------------------------------------------------------------------
459 SetHandler perl-script
460 PerlHandler OpenILS::WWW::XMLRPCGateway
466 # ----------------------------------------------------------------------------------
467 # Conify - next-generation Evergreen administration interface
468 # ----------------------------------------------------------------------------------
470 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
474 XMLEntEscapeScript "no"
475 XMLEntStripComments "no"
476 XMLEntContentType "text/html; charset=utf-8"
477 AddOutputFilter INCLUDES;XMLENT .html
479 SetHandler perl-script
480 PerlSetVar OILSProxyTitle "Dojo Admin Login"
481 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to administer Evergreen"
482 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
483 PerlHandler OpenILS::WWW::Proxy
489 # ----------------------------------------------------------------------------------
490 # Vandelay importers / exporters (your Web interface to bibliographic travel)
491 # ----------------------------------------------------------------------------------
492 RedirectMatch 301 ^/vandelay/vandelay.xml(.*)$ /vandelay/en-US/vandelay.xml$1
495 RewriteRule ^/vandelay/([a-z]{2}-[A-Z]{2})/(.*)$ /vandelay/$2 [E=locale:$1]
497 <LocationMatch /vandelay.*xml>
499 XMLEntEscapeScript "no"
500 XMLEntStripComments "yes"
501 XMLEntContentType "text/html; charset=utf-8"
502 XMLEntStripDoctype "yes"
503 AddOutputFilter INCLUDES;XMLENT .xml
504 SetHandler perl-script
505 PerlSetVar OILSProxyTitle "Vandelay Login"
506 PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to import MARC records"
507 PerlSetVar OILSProxyPermissions "IMPORT_MARC"
508 PerlHandler OpenILS::WWW::Proxy
513 <Location /vandelay-upload>
514 SetHandler perl-script
515 PerlHandler OpenILS::WWW::Vandelay::spool_marc
520 # OpenURL 0.1 searching based on OpenSearch
522 RewriteMap openurl prg:/openils/bin/openurl_map.pl
523 RewriteCond %{QUERY_STRING} (^.*$)
524 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
528 # General Evergreen web template processor
530 SetHandler perl-script
531 PerlHandler OpenILS::WWW::EGWeb
536 # Note: the template processor will decline handling anything it does not
537 # have an explicit configuration for, which means it will fall back to
538 # Apache to serve the file. However, in the interest of speed, go ahead
539 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
540 # Add more exemptions as needed.
541 <LocationMatch ^/eg/.*(\.js|\.css|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
545 # ----------------------------------------------------------------------------------
546 # Some mod_deflate logging setup
547 # ----------------------------------------------------------------------------------
548 <IfModule mod_deflate.c>
549 DeflateFilterNote Input instream
550 DeflateFilterNote Output outstream
551 DeflateFilterNote Ratio ratio
553 LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
554 CustomLog /var/log/apache2/deflate_log deflate