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
239 <LocationMatch /xul/.*\.xul$>
241 XMLEntContentType "application/vnd.mozilla.xul+xml"
242 AddOutputFilter INCLUDES;XMLENT .xul
247 # ----------------------------------------------------------------------------------
248 # Self-serve password interface
249 # ----------------------------------------------------------------------------------
250 <Location /opac/password>
251 SetHandler perl-script
252 PerlHandler OpenILS::WWW::PasswordReset::password_reset
257 # Force clients to use HTTPS
258 RewriteCond %{HTTPS} !=on [NC]
259 RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
262 # ----------------------------------------------------------------------------------
264 # ----------------------------------------------------------------------------------
265 <Location /opac/extras/oisbn>
266 SetHandler perl-script
267 PerlHandler OpenILS::WWW::SuperCat::oisbn
272 <Location /opac/extras/supercat>
273 SetHandler perl-script
274 PerlHandler OpenILS::WWW::SuperCat::supercat
279 <Location /opac/extras/unapi>
280 SetHandler perl-script
281 PerlHandler OpenILS::WWW::SuperCat::unapi
286 <Location /opac/extras/feed/bookbag>
287 SetHandler perl-script
288 PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
293 <Location /opac/extras/opensearch>
294 SetHandler perl-script
295 PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
300 <Location /opac/extras/sru>
301 SetHandler perl-script
302 PerlHandler OpenILS::WWW::SuperCat::sru_search
307 <Location /opac/extras/sru_auth>
308 SetHandler perl-script
309 PerlHandler OpenILS::WWW::SuperCat::sru_auth_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
390 AuthName "Exporter Login"
391 PerlOptions +GlobalRequest
392 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
393 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
395 PerlHandler OpenILS::WWW::Exporter
401 <Location /opac/extras/merge_template>
402 SetHandler perl-script
404 AuthName "Batch Update Login"
405 PerlOptions +GlobalRequest
406 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
407 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
409 PerlHandler OpenILS::WWW::TemplateBatchBibUpdate
415 <Location /opac/extras/circ>
417 AuthName "Circ Extras Login"
418 PerlOptions +GlobalRequest
419 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
420 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
427 # ----------------------------------------------------------------------------------
428 # Reporting output lives here
429 # ----------------------------------------------------------------------------------
430 <Location /reporter/>
432 AuthName "Report Login"
433 PerlOptions +GlobalRequest
434 PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
435 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
442 # ----------------------------------------------------------------------------------
443 # Selfcheck interface
444 # ----------------------------------------------------------------------------------
445 <LocationMatch .*/selfcheck.xml>
447 AuthName "Self-check Login"
448 PerlOptions +GlobalRequest
449 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
450 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
458 # ----------------------------------------------------------------------------------
460 # ----------------------------------------------------------------------------------
461 <LocationMatch /reports>
463 AddOutputFilter INCLUDES;XMLENT .xhtml
466 <LocationMatch /reports/fm_IDL.xml>
467 IDLChunkStripPI "yes"
468 IDLChunkEscapeScript "no"
469 IDLChunkStripComments "yes"
470 IDLChunkStripDoctype "yes"
471 IDLChunkContentType "application/xml; charset=utf-8"
472 AddOutputFilter INCLUDES;IDLCHUNK .xml
475 # ----------------------------------------------------------------------------------
477 # ----------------------------------------------------------------------------------
479 SetHandler perl-script
480 PerlHandler OpenILS::WWW::EDI
486 # ----------------------------------------------------------------------------------
488 # ----------------------------------------------------------------------------------
490 SetHandler perl-script
491 PerlHandler OpenILS::WWW::XMLRPCGateway
497 # ----------------------------------------------------------------------------------
498 # Conify - next-generation Evergreen administration interface
499 # ----------------------------------------------------------------------------------
500 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
504 XMLEntEscapeScript "no"
505 XMLEntStripComments "no"
506 XMLEntContentType "text/html; charset=utf-8"
507 AddOutputFilter INCLUDES;XMLENT .html
510 AuthName "Dojo Admin Login"
511 PerlOptions +GlobalRequest
512 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
513 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
520 <Location /vandelay-upload>
521 SetHandler perl-script
522 PerlHandler OpenILS::WWW::Vandelay::spool_marc
527 # OpenURL 0.1 searching based on OpenSearch
528 RewriteMap openurl prg:/openils/bin/openurl_map.pl
529 RewriteCond %{QUERY_STRING} (^.*$)
530 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
534 # General Evergreen web template processor
536 SetHandler perl-script
537 PerlHandler OpenILS::WWW::EGWeb
542 PerlSetVar OILSWebBasePath "/eg"
543 PerlSetVar OILSWebWebDir "/openils/var/web"
544 PerlSetVar OILSWebDefaultTemplateExtension "tt2"
546 # Enable Template-Toolkit error debugging messages (apache error log)
547 PerlSetVar OILSWebDebugTemplate "true"
549 # -------------------------------------------------------
550 # Media Prefix. In the 3rd example, the protocol (http) is enforced
551 #PerlSetVar OILSWebMediaPrefix "/media"
552 #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
553 #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
555 # Locale messages files
556 #PerlAddVar OILSWebLocale "en"
557 #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en.po"
558 #PerlAddVar OILSWebLocale "en_ca"
559 #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en_ca.po"
560 #PerlAddVar OILSWebLocale "fr_ca"
561 #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.fr_ca.po"
563 # Templates will be loaded from the following paths in reverse order.
564 PerlAddVar OILSWebTemplatePath "/openils/var/templates"
565 #PerlAddVar OILSWebTemplatePath "/openils/var/templates_localskin"
567 <IfModule mod_deflate.c>
568 SetOutputFilter DEFLATE
569 BrowserMatch ^Mozilla/4 gzip-only-text/html
570 BrowserMatch ^Mozilla/4\.0[678] no-gzip
571 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
572 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
573 <IfModule mod_headers.c>
574 Header append Cache-Control "public"
575 Header append Vary User-Agent env=!dont-vary
579 <LocationMatch ^/(images|css|js)/>
580 # should pick up the default expire time from eg.conf...
581 <IfModule mod_deflate.c>
582 SetOutputFilter DEFLATE
583 BrowserMatch ^Mozilla/4 gzip-only-text/html
584 BrowserMatch ^Mozilla/4\.0[678] no-gzip
585 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
586 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
587 <IfModule mod_headers.c>
588 Header append Cache-Control "public"
589 Header append Vary User-Agent env=!dont-vary
594 PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
595 # Expire the HTML quickly since we're loading dynamic data for each page
597 ExpiresByType text/html "access plus 5 seconds"
599 # For use with embedded Content Cafe content
600 #SetEnv OILS_CONTENT_CAFE_USER 123
601 #SetEnv OILS_CONTENT_CAFE_PASS 456
602 # Consider copying/moving other added content configs
603 # (e.g. NOVELIST) into here or to an outer container shared by
604 # both /opac and /eg/opac since some are used in both places
608 # Note: the template processor will decline handling anything it does not
609 # have an explicit configuration for, which means it will fall back to
610 # Apache to serve the file. However, in the interest of speed, go ahead
611 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
612 # Add more exemptions as needed.
613 <LocationMatch ^/eg/.*(\.js|\.css|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
617 # ----------------------------------------------------------------------------------
618 # Some mod_deflate logging setup
619 # ----------------------------------------------------------------------------------
620 <IfModule mod_deflate.c>
621 DeflateFilterNote Input instream
622 DeflateFilterNote Output outstream
623 DeflateFilterNote Ratio ratio
625 LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
626 CustomLog /var/log/apache2/deflate_log deflate
628 # There are problems with XMLENT and mod_deflate - so lets disable it
629 # This is where we don't have a pre-existing LocationMatch directive earlier
630 <LocationMatch /opac/.*\.xml$>
633 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
636 <LocationMatch /reports/.*\.xhtml$>
639 <LocationMatch /conify/.*\.html$>
647 SetHandler perl-script
648 PerlHandler OpenILS::WWW::IDL2js
653 <IfModule mod_headers.c>
654 Header append Cache-Control "public"
657 <IfModule mod_deflate.c>
658 SetOutputFilter DEFLATE
659 BrowserMatch ^Mozilla/4 gzip-only-text/html
660 BrowserMatch ^Mozilla/4\.0[678] no-gzip
661 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
662 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
663 <IfModule mod_headers.c>
664 Header append Vary User-Agent env=!dont-vary
669 # Uncomment the following to force SSL for everything. Note that this defeats caching
670 # and you will suffer a performance hit.
671 #RewriteCond %{HTTPS} off
672 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]