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 # Autosuggest for searches
55 <Location /opac/extras/autosuggest>
56 SetHandler perl-script
57 PerlHandler OpenILS::WWW::AutoSuggest
62 # ----------------------------------------------------------------------------------
63 # Replace broken cover images with a transparent GIF by default
64 # ----------------------------------------------------------------------------------
66 RewriteRule ^/opac/extras/ac/jacket/(small|medium|large)/$ \
67 /opac/images/blank.png [P,L]
69 # ----------------------------------------------------------------------------------
70 # Add the row ID (RID) and date so we can make unAPI happy
71 # ----------------------------------------------------------------------------------
72 RewriteCond %{QUERY_STRING} (^r|&r)=(\d+)
73 RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}]
75 # ----------------------------------------------------------------------------------
76 # Pull the locale from the URL
77 # ----------------------------------------------------------------------------------
78 RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
79 RewriteRule . - [E=locale:%1]
81 # ----------------------------------------------------------------------------------
82 # For sanity reasons, default indexes to Off
83 # ----------------------------------------------------------------------------------
86 # ----------------------------------------------------------------------------------
88 # ----------------------------------------------------------------------------------
89 <LocationMatch /opac/>
90 AddType application/xhtml+xml .xml
92 # - configure mod_xmlent
94 XMLEntEscapeScript "no"
95 XMLEntStripComments "yes"
96 XMLEntContentType "text/html; charset=utf-8"
97 # forces quirks mode which we want for now
98 XMLEntStripDoctype "yes"
100 # - set up the include handlers
102 AddOutputFilter INCLUDES .xsl
103 AddOutputFilter INCLUDES;XMLENT .xml
105 SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
107 # This gives you the option to configure a different host to serve OPAC images from
108 # Specify the hostname (without protocol) and path to the images. Protocol will
109 # be determined at runtime
110 #SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=static.example.org/opac/
112 # In addition to loading images from a static host, you can also load CSS and/or
113 # Javascript from a static host or hosts. Protocol will be determined at runtime
114 # and/or by configuration options immediately following.
115 #SetEnvIf Request_URI ".*" OILS_OPAC_CSS_HOST=static.example.org/opac/
116 #SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=static.example.org/opac/
118 # If you are not able to serve static content via https and
119 # wish to force http:// (and are comfortable with mixed-content
120 # warnings in client browsers), set this:
121 #SetEnvIf Request_URI ".*" OILS_OPAC_STATIC_PROTOCOL=http
123 # If you would prefer to fall back to your non-static servers for
124 # https pages, avoiding mixed-content warnings in client browsers
125 # and are willing to accept some increased server load, set this:
126 #SetEnvIf Request_URI ".*" OILS_OPAC_BYPASS_STATIC_FOR_HTTPS=yes
128 # Specify a ChiliFresh account to integrate their services with the OPAC
129 #SetEnv OILS_CHILIFRESH_ACCOUNT
130 #SetEnv OILS_CHILIFRESH_PROFILE
131 #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
132 #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
134 # Specify the initial script URL for Novelist (containing account credentials, etc.)
135 #SetEnv OILS_NOVELIST_URL
138 # Uncomment to force SSL any time a patron is logged in. This protects
139 # authentication tokens. Left commented out for backwards compat for now.
140 #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
142 # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js
143 #SetEnv OILS_OPAC_COMBINED_JS 1
148 # ----------------------------------------------------------------------------------
149 # Some mod_deflate fun
150 # ----------------------------------------------------------------------------------
151 <IfModule mod_deflate.c>
152 SetOutputFilter DEFLATE
154 BrowserMatch ^Mozilla/4 gzip-only-text/html
155 BrowserMatch ^Mozilla/4\.0[678] no-gzip
156 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
158 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
160 <IfModule mod_headers.c>
161 Header append Vary User-Agent env=!dont-vary
168 # ----------------------------------------------------------------------------------
169 # Some mod_deflate fun
170 # ----------------------------------------------------------------------------------
171 <IfModule mod_deflate.c>
172 SetOutputFilter DEFLATE
174 BrowserMatch ^Mozilla/4 gzip-only-text/html
175 BrowserMatch ^Mozilla/4\.0[678] no-gzip
176 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
178 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
180 <IfModule mod_headers.c>
181 Header append Vary User-Agent env=!dont-vary
187 # ----------------------------------------------------------------------------------
188 # Force SSL on the OPAC's "My Account" page
189 # ----------------------------------------------------------------------------------
190 <LocationMatch .*/myopac.xml>
194 <LocationMatch /opac/extras/>
195 # Force to en-US for now to satisfy bbags.xml
198 AddOutputFilter INCLUDES .xml
199 AddType application/xhtml+xml .xml
202 RewriteCond %{QUERY_STRING} locale=([^&]*)
203 RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
204 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
205 AddOutputFilter INCLUDES;XMLENT .html
208 # ----------------------------------------------------------------------------------
209 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
210 # ----------------------------------------------------------------------------------
211 RewriteCond %{HTTP:Accept-Language} ([a-z]{2}-[A-Z]{2})
212 RewriteRule ^/xul/ - [E=locale:%1]
213 RewriteRule ^/reports/ - [E=locale:%1]
215 # Default to en-US if we haven't matched a locale of the form xx-YY
216 RewriteCond %{HTTP:Accept-Language} !([a-z]{2}-[A-Z]{2})
217 RewriteRule ^/xul/ - [E=locale:en-US]
218 RewriteRule ^/reports/ - [E=locale:en-US]
220 # Default to en-US if we are just given en
221 RewriteCond %{ENV:locale} ^$ [OR]
222 RewriteCond %{ENV:locale} ^en$
223 RewriteRule . - [E=locale:en-US]
225 <LocationMatch /xul/.*\.x?html$>
227 XMLEntEscapeScript "no"
228 XMLEntStripComments "yes"
230 XMLEntStripDoctype "yes"
231 XMLEntContentType "text/html; charset=utf-8"
232 AddOutputFilter INCLUDES;XMLENT .xhtml
233 AddOutputFilter INCLUDES;XMLENT .html
238 <LocationMatch /xul/.*\.xul$>
240 XMLEntContentType "application/vnd.mozilla.xul+xml"
241 AddOutputFilter INCLUDES;XMLENT .xul
245 # ----------------------------------------------------------------------------------
246 # Self-serve password interface
247 # ----------------------------------------------------------------------------------
248 <Location /opac/password>
249 SetHandler perl-script
250 PerlHandler OpenILS::WWW::PasswordReset::password_reset
255 # Force clients to use HTTPS
256 RewriteCond %{HTTPS} !=on [NC]
257 RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
260 # ----------------------------------------------------------------------------------
262 # ----------------------------------------------------------------------------------
263 <Location /opac/extras/oisbn>
264 SetHandler perl-script
265 PerlHandler OpenILS::WWW::SuperCat::oisbn
270 <Location /opac/extras/supercat>
271 SetHandler perl-script
272 PerlHandler OpenILS::WWW::SuperCat::supercat
277 <Location /opac/extras/unapi>
278 SetHandler perl-script
279 PerlHandler OpenILS::WWW::SuperCat::unapi
284 <Location /opac/extras/feed/bookbag>
285 SetHandler perl-script
286 PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
291 <Location /opac/extras/opensearch>
292 SetHandler perl-script
293 PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
298 <Location /opac/extras/sru>
299 SetHandler perl-script
300 PerlHandler OpenILS::WWW::SuperCat::sru_search
305 <Location /opac/extras/sru_auth>
306 SetHandler perl-script
307 PerlHandler OpenILS::WWW::SuperCat::sru_auth_search
312 <Location /opac/extras/feed/freshmeat>
313 SetHandler perl-script
314 PerlHandler OpenILS::WWW::SuperCat::changes_feed
319 <Location /opac/extras/browse>
320 SetHandler perl-script
321 PerlHandler OpenILS::WWW::SuperCat::string_browse
326 <Location /opac/extras/startwith>
327 SetHandler perl-script
328 PerlHandler OpenILS::WWW::SuperCat::string_startwith
334 # ----------------------------------------------------------------------------------
335 # Module for displaying OpenSRF API documentation
336 # ----------------------------------------------------------------------------------
337 <Location /opac/extras/docgen.xsl>
338 AddOutputFilter INCLUDES .xsl
341 # ----------------------------------------------------------------------------------
342 # Module for processing staff-client offline scripts lives here
343 # ----------------------------------------------------------------------------------
344 <Directory "/openils/var/cgi-bin/offline">
345 AddHandler cgi-script .pl
352 # ----------------------------------------------------------------------------------
353 # XXX Note, it's important to explicitly set the JSON encoding style
354 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change
356 # ----------------------------------------------------------------------------------
357 # OpenSRF JSON legacy gateway
358 # ----------------------------------------------------------------------------------
360 SetHandler osrf_json_gateway_module
361 OSRFGatewayLegacyJSON "true"
364 # ----------------------------------------------------------------------------------
365 # New-style OpenSRF JSON gateway
366 # ----------------------------------------------------------------------------------
367 <Location /osrf-gateway-v1>
368 SetHandler osrf_json_gateway_module
369 OSRFGatewayLegacyJSON "false"
373 # ----------------------------------------------------------------------------------
374 # OpenSRF-over-HTTP translator
375 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
376 # ----------------------------------------------------------------------------------
377 <Location /osrf-http-translator>
378 SetHandler osrf_http_translator_module
382 # ----------------------------------------------------------------------------------
383 # The exporter lives here
384 # ----------------------------------------------------------------------------------
386 SetHandler perl-script
388 AuthName "Exporter Login"
389 PerlOptions +GlobalRequest
390 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
391 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
393 PerlHandler OpenILS::WWW::Exporter
399 <Location /opac/extras/merge_template>
400 SetHandler perl-script
402 AuthName "Batch Update Login"
403 PerlOptions +GlobalRequest
404 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
405 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
407 PerlHandler OpenILS::WWW::TemplateBatchBibUpdate
413 <Location /opac/extras/circ>
415 AuthName "Circ Extras Login"
416 PerlOptions +GlobalRequest
417 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
418 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
425 # ----------------------------------------------------------------------------------
426 # Reporting output lives here
427 # ----------------------------------------------------------------------------------
428 <Location /reporter/>
430 AuthName "Report Login"
431 PerlOptions +GlobalRequest
432 PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
433 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
440 # ----------------------------------------------------------------------------------
441 # Selfcheck interface
442 # ----------------------------------------------------------------------------------
443 <LocationMatch .*/selfcheck.xml>
445 AuthName "Self-check Login"
446 PerlOptions +GlobalRequest
447 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
448 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
456 # ----------------------------------------------------------------------------------
458 # ----------------------------------------------------------------------------------
459 <LocationMatch /reports>
461 AddOutputFilter INCLUDES;XMLENT .xhtml
464 <LocationMatch /reports/fm_IDL.xml>
465 IDLChunkStripPI "yes"
466 IDLChunkEscapeScript "no"
467 IDLChunkStripComments "yes"
468 IDLChunkStripDoctype "yes"
469 IDLChunkContentType "application/xml; charset=utf-8"
470 AddOutputFilter INCLUDES;IDLCHUNK .xml
473 # ----------------------------------------------------------------------------------
475 # ----------------------------------------------------------------------------------
477 SetHandler perl-script
478 PerlHandler OpenILS::WWW::EDI
484 # ----------------------------------------------------------------------------------
486 # ----------------------------------------------------------------------------------
488 SetHandler perl-script
489 PerlHandler OpenILS::WWW::XMLRPCGateway
495 # ----------------------------------------------------------------------------------
496 # Conify - next-generation Evergreen administration interface
497 # ----------------------------------------------------------------------------------
498 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
502 XMLEntEscapeScript "no"
503 XMLEntStripComments "no"
504 XMLEntContentType "text/html; charset=utf-8"
505 AddOutputFilter INCLUDES;XMLENT .html
508 AuthName "Dojo Admin Login"
509 PerlOptions +GlobalRequest
510 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
511 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
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"
544 # Enable Template-Toolkit error debugging messages (apache error log)
545 PerlSetVar OILSWebDebugTemplate "true"
547 # -------------------------------------------------------
548 # Media Prefix. In the 3rd example, the protocol (http) is enforced
549 #PerlSetVar OILSWebMediaPrefix "/media"
550 #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
551 #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
553 # Locale messages files
554 #PerlAddVar OILSWebLocale "en"
555 #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en.po"
556 #PerlAddVar OILSWebLocale "en_ca"
557 #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en_ca.po"
558 #PerlAddVar OILSWebLocale "fr_ca"
559 #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.fr_ca.po"
561 # Templates will be loaded from the following paths in reverse order.
562 PerlAddVar OILSWebTemplatePath "/openils/var/templates"
563 #PerlAddVar OILSWebTemplatePath "/openils/var/templates_localskin"
565 <IfModule mod_deflate.c>
566 SetOutputFilter DEFLATE
567 BrowserMatch ^Mozilla/4 gzip-only-text/html
568 BrowserMatch ^Mozilla/4\.0[678] no-gzip
569 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
570 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
571 <IfModule mod_headers.c>
572 Header append Cache-Control "public"
573 Header append Vary User-Agent env=!dont-vary
577 <LocationMatch ^/(images|css|js)/>
578 # should pick up the default expire time from eg.conf...
579 <IfModule mod_deflate.c>
580 SetOutputFilter DEFLATE
581 BrowserMatch ^Mozilla/4 gzip-only-text/html
582 BrowserMatch ^Mozilla/4\.0[678] no-gzip
583 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
584 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
585 <IfModule mod_headers.c>
586 Header append Cache-Control "public"
587 Header append Vary User-Agent env=!dont-vary
592 PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
593 # Expire the HTML quickly since we're loading dynamic data for each page
595 ExpiresByType text/html "access plus 5 seconds"
597 # For use with embedded Content Cafe content
598 #SetEnv OILS_CONTENT_CAFE_USER 123
599 #SetEnv OILS_CONTENT_CAFE_PASS 456
600 # Consider copying/moving other added content configs
601 # (e.g. NOVELIST) into here or to an outer container shared by
602 # both /opac and /eg/opac since some are used in both places
606 # Note: the template processor will decline handling anything it does not
607 # have an explicit configuration for, which means it will fall back to
608 # Apache to serve the file. However, in the interest of speed, go ahead
609 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
610 # Add more exemptions as needed.
611 <LocationMatch ^/eg/.*(\.js|\.css|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
615 # ----------------------------------------------------------------------------------
616 # Some mod_deflate logging setup
617 # ----------------------------------------------------------------------------------
618 <IfModule mod_deflate.c>
619 DeflateFilterNote Input instream
620 DeflateFilterNote Output outstream
621 DeflateFilterNote Ratio ratio
623 LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
624 CustomLog /var/log/apache2/deflate_log deflate
630 SetHandler perl-script
631 PerlHandler OpenILS::WWW::IDL2js
636 <IfModule mod_headers.c>
637 Header append Cache-Control "public"
640 <IfModule mod_deflate.c>
641 SetOutputFilter DEFLATE
642 BrowserMatch ^Mozilla/4 gzip-only-text/html
643 BrowserMatch ^Mozilla/4\.0[678] no-gzip
644 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
645 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
646 <IfModule mod_headers.c>
647 Header append Vary User-Agent env=!dont-vary
652 # Uncomment the following to force SSL for everything. Note that this defeats caching
653 # and you will suffer a performance hit.
654 #RewriteCond %{HTTPS} off
655 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]