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 # ----------------------------------------------------------------------------------
55 # Replace broken cover images with a transparent GIF by default
56 # ----------------------------------------------------------------------------------
58 RewriteRule ^/opac/extras/ac/jacket/(small|medium|large)/$ \
59 /opac/images/blank.png [P,L]
61 # ----------------------------------------------------------------------------------
62 # Add the row ID (RID) and date so we can make unAPI happy
63 # ----------------------------------------------------------------------------------
64 RewriteCond %{QUERY_STRING} (^r|&r)=(\d+)
65 RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}]
67 # ----------------------------------------------------------------------------------
68 # Pull the locale from the URL
69 # ----------------------------------------------------------------------------------
70 RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
71 RewriteRule . - [E=locale:%1]
73 # ----------------------------------------------------------------------------------
74 # For sanity reasons, default indexes to Off
75 # ----------------------------------------------------------------------------------
78 # ----------------------------------------------------------------------------------
80 # ----------------------------------------------------------------------------------
81 <LocationMatch /opac/>
82 AddType application/xhtml+xml .xml
84 # - configure mod_xmlent
86 XMLEntEscapeScript "no"
87 XMLEntStripComments "yes"
88 XMLEntContentType "text/html; charset=utf-8"
89 # forces quirks mode which we want for now
90 XMLEntStripDoctype "yes"
92 # - set up the include handlers
94 AddOutputFilter INCLUDES .xsl
95 AddOutputFilter INCLUDES;XMLENT .xml
97 SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
99 # This gives you the option to configure a different host to serve OPAC images from
100 # Specify the hostname (without protocol) and path to the images. Protocol will
101 # be determined at runtime
102 #SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=static.example.org/opac/
104 # In addition to loading images from a static host, you can also load CSS and/or
105 # Javascript from a static host or hosts. Protocol will be determined at runtime
106 # and/or by configuration options immediately following.
107 #SetEnvIf Request_URI ".*" OILS_OPAC_CSS_HOST=static.example.org/opac/
108 #SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=static.example.org/opac/
110 # If you are not able to serve static content via https and
111 # wish to force http:// (and are comfortable with mixed-content
112 # warnings in client browsers), set this:
113 #SetEnvIf Request_URI ".*" OILS_OPAC_STATIC_PROTOCOL=http
115 # If you would prefer to fall back to your non-static servers for
116 # https pages, avoiding mixed-content warnings in client browsers
117 # and are willing to accept some increased server load, set this:
118 #SetEnvIf Request_URI ".*" OILS_OPAC_BYPASS_STATIC_FOR_HTTPS=yes
120 # Specify a ChiliFresh account to integrate their services with the OPAC
121 #SetEnv OILS_CHILIFRESH_ACCOUNT
122 #SetEnv OILS_CHILIFRESH_PROFILE
123 #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
124 #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
126 # Specify the initial script URL for Novelist (containing account credentials, etc.)
127 #SetEnv OILS_NOVELIST_URL
130 # Uncomment to force SSL any time a patron is logged in. This protects
131 # authentication tokens. Left commented out for backwards compat for now.
132 #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
134 # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js
135 #SetEnv OILS_OPAC_COMBINED_JS 1
140 # ----------------------------------------------------------------------------------
141 # Some mod_deflate fun
142 # ----------------------------------------------------------------------------------
143 <IfModule mod_deflate.c>
144 SetOutputFilter DEFLATE
146 BrowserMatch ^Mozilla/4 gzip-only-text/html
147 BrowserMatch ^Mozilla/4\.0[678] no-gzip
148 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
150 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
152 <IfModule mod_headers.c>
153 Header append Vary User-Agent env=!dont-vary
160 # ----------------------------------------------------------------------------------
161 # Some mod_deflate fun
162 # ----------------------------------------------------------------------------------
163 <IfModule mod_deflate.c>
164 SetOutputFilter DEFLATE
166 BrowserMatch ^Mozilla/4 gzip-only-text/html
167 BrowserMatch ^Mozilla/4\.0[678] no-gzip
168 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
170 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
172 <IfModule mod_headers.c>
173 Header append Vary User-Agent env=!dont-vary
179 # ----------------------------------------------------------------------------------
180 # Force SSL on the OPAC's "My Account" page
181 # ----------------------------------------------------------------------------------
182 <LocationMatch .*/myopac.xml>
186 <LocationMatch /opac/extras/>
187 # Force to en-US for now to satisfy bbags.xml
190 AddOutputFilter INCLUDES .xml
191 AddType application/xhtml+xml .xml
194 RewriteCond %{QUERY_STRING} locale=([^&]*)
195 RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
196 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
197 AddOutputFilter INCLUDES;XMLENT .html
200 # ----------------------------------------------------------------------------------
201 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
202 # ----------------------------------------------------------------------------------
203 RewriteCond %{HTTP:Accept-Language} ([a-z]{2}-[A-Z]{2})
204 RewriteRule ^/xul/ - [E=locale:%1]
205 RewriteRule ^/reports/ - [E=locale:%1]
207 # Default to en-US if we haven't matched a locale of the form xx-YY
208 RewriteCond %{HTTP:Accept-Language} !([a-z]{2}-[A-Z]{2})
209 RewriteRule ^/xul/ - [E=locale:en-US]
210 RewriteRule ^/reports/ - [E=locale:en-US]
212 # Default to en-US if we are just given en
213 RewriteCond %{ENV:locale} ^$ [OR]
214 RewriteCond %{ENV:locale} ^en$
215 RewriteRule . - [E=locale:en-US]
217 <LocationMatch /xul/.*\.x?html$>
219 XMLEntEscapeScript "no"
220 XMLEntStripComments "yes"
222 XMLEntStripDoctype "yes"
223 XMLEntContentType "text/html; charset=utf-8"
224 AddOutputFilter INCLUDES;XMLENT .xhtml
225 AddOutputFilter INCLUDES;XMLENT .html
230 <LocationMatch /xul/.*\.xul$>
232 XMLEntContentType "application/vnd.mozilla.xul+xml"
233 AddOutputFilter INCLUDES;XMLENT .xul
237 # ----------------------------------------------------------------------------------
238 # Self-serve password interface
239 # ----------------------------------------------------------------------------------
240 <Location /opac/password>
241 SetHandler perl-script
242 PerlHandler OpenILS::WWW::PasswordReset::password_reset
247 # Force clients to use HTTPS
248 RewriteCond %{HTTPS} !=on [NC]
249 RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
252 # ----------------------------------------------------------------------------------
254 # ----------------------------------------------------------------------------------
255 <Location /opac/extras/oisbn>
256 SetHandler perl-script
257 PerlHandler OpenILS::WWW::SuperCat::oisbn
262 <Location /opac/extras/supercat>
263 SetHandler perl-script
264 PerlHandler OpenILS::WWW::SuperCat::supercat
269 <Location /opac/extras/unapi>
270 SetHandler perl-script
271 PerlHandler OpenILS::WWW::SuperCat::unapi
276 <Location /opac/extras/feed/bookbag>
277 SetHandler perl-script
278 PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
283 <Location /opac/extras/opensearch>
284 SetHandler perl-script
285 PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
290 <Location /opac/extras/sru>
291 SetHandler perl-script
292 PerlHandler OpenILS::WWW::SuperCat::sru_search
297 <Location /opac/extras/sru_auth>
298 SetHandler perl-script
299 PerlHandler OpenILS::WWW::SuperCat::sru_auth_search
304 <Location /opac/extras/feed/freshmeat>
305 SetHandler perl-script
306 PerlHandler OpenILS::WWW::SuperCat::changes_feed
311 <Location /opac/extras/browse>
312 SetHandler perl-script
313 PerlHandler OpenILS::WWW::SuperCat::string_browse
318 <Location /opac/extras/startwith>
319 SetHandler perl-script
320 PerlHandler OpenILS::WWW::SuperCat::string_startwith
326 # ----------------------------------------------------------------------------------
327 # Module for displaying OpenSRF API documentation
328 # ----------------------------------------------------------------------------------
329 <Location /opac/extras/docgen.xsl>
330 AddOutputFilter INCLUDES .xsl
333 # ----------------------------------------------------------------------------------
334 # Module for processing staff-client offline scripts lives here
335 # ----------------------------------------------------------------------------------
336 <Directory "/openils/var/cgi-bin/offline">
337 AddHandler cgi-script .pl
344 # ----------------------------------------------------------------------------------
345 # XXX Note, it's important to explicitly set the JSON encoding style
346 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change
348 # ----------------------------------------------------------------------------------
349 # OpenSRF JSON legacy gateway
350 # ----------------------------------------------------------------------------------
352 SetHandler osrf_json_gateway_module
353 OSRFGatewayLegacyJSON "true"
356 # ----------------------------------------------------------------------------------
357 # New-style OpenSRF JSON gateway
358 # ----------------------------------------------------------------------------------
359 <Location /osrf-gateway-v1>
360 SetHandler osrf_json_gateway_module
361 OSRFGatewayLegacyJSON "false"
365 # ----------------------------------------------------------------------------------
366 # OpenSRF-over-HTTP translator
367 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
368 # ----------------------------------------------------------------------------------
369 <Location /osrf-http-translator>
370 SetHandler osrf_http_translator_module
374 # ----------------------------------------------------------------------------------
375 # The exporter lives here
376 # ----------------------------------------------------------------------------------
378 SetHandler perl-script
380 AuthName "Exporter Login"
381 PerlOptions +GlobalRequest
382 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
383 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
385 PerlHandler OpenILS::WWW::Exporter
391 <Location /opac/extras/merge_template>
392 SetHandler perl-script
394 AuthName "Batch Update Login"
395 PerlOptions +GlobalRequest
396 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
397 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
399 PerlHandler OpenILS::WWW::TemplateBatchBibUpdate
405 <Location /opac/extras/circ>
407 AuthName "Circ Extras Login"
408 PerlOptions +GlobalRequest
409 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
410 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
417 # ----------------------------------------------------------------------------------
418 # Reporting output lives here
419 # ----------------------------------------------------------------------------------
420 <Location /reporter/>
422 AuthName "Report Login"
423 PerlOptions +GlobalRequest
424 PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
425 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
432 # ----------------------------------------------------------------------------------
433 # Selfcheck interface
434 # ----------------------------------------------------------------------------------
435 <LocationMatch .*/selfcheck.xml>
437 AuthName "Self-check Login"
438 PerlOptions +GlobalRequest
439 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
440 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
448 # ----------------------------------------------------------------------------------
450 # ----------------------------------------------------------------------------------
451 <LocationMatch /reports>
453 AddOutputFilter INCLUDES;XMLENT .xhtml
456 <LocationMatch /reports/fm_IDL.xml>
457 IDLChunkStripPI "yes"
458 IDLChunkEscapeScript "no"
459 IDLChunkStripComments "yes"
460 IDLChunkStripDoctype "yes"
461 IDLChunkContentType "application/xml; charset=utf-8"
462 AddOutputFilter INCLUDES;IDLCHUNK .xml
465 # ----------------------------------------------------------------------------------
467 # ----------------------------------------------------------------------------------
469 SetHandler perl-script
470 PerlHandler OpenILS::WWW::EDI
476 # ----------------------------------------------------------------------------------
478 # ----------------------------------------------------------------------------------
480 SetHandler perl-script
481 PerlHandler OpenILS::WWW::XMLRPCGateway
487 # ----------------------------------------------------------------------------------
488 # Conify - next-generation Evergreen administration interface
489 # ----------------------------------------------------------------------------------
490 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
494 XMLEntEscapeScript "no"
495 XMLEntStripComments "no"
496 XMLEntContentType "text/html; charset=utf-8"
497 AddOutputFilter INCLUDES;XMLENT .html
500 AuthName "Dojo Admin Login"
501 PerlOptions +GlobalRequest
502 PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
503 PerlAuthenHandler OpenILS::WWW::Proxy::Authen
510 <Location /vandelay-upload>
511 SetHandler perl-script
512 PerlHandler OpenILS::WWW::Vandelay::spool_marc
517 # OpenURL 0.1 searching based on OpenSearch
518 RewriteMap openurl prg:/openils/bin/openurl_map.pl
519 RewriteCond %{QUERY_STRING} (^.*$)
520 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
524 # General Evergreen web template processor
526 SetHandler perl-script
527 PerlHandler OpenILS::WWW::EGWeb
532 PerlSetVar OILSWebBasePath "/eg"
533 PerlSetVar OILSWebWebDir "/openils/var/web"
534 PerlSetVar OILSWebDefaultTemplateExtension "tt2"
536 # Enable Template-Toolkit error debugging messages (apache error log)
537 PerlSetVar OILSWebDebugTemplate "true"
539 # -------------------------------------------------------
540 # Media Prefix. In the 3rd example, the protocol (http) is enforced
541 #PerlSetVar OILSWebMediaPrefix "/media"
542 #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
543 #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
545 # Locale messages files
546 #PerlAddVar OILSWebLocale "en"
547 #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en.po"
548 #PerlAddVar OILSWebLocale "en_ca"
549 #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en_ca.po"
550 #PerlAddVar OILSWebLocale "fr_ca"
551 #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.fr_ca.po"
553 # Templates will be loaded from the following paths in reverse order.
554 PerlAddVar OILSWebTemplatePath "/openils/var/templates"
555 #PerlAddVar OILSWebTemplatePath "/openils/var/templates_localskin"
557 <IfModule mod_deflate.c>
558 SetOutputFilter DEFLATE
559 BrowserMatch ^Mozilla/4 gzip-only-text/html
560 BrowserMatch ^Mozilla/4\.0[678] no-gzip
561 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
562 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
563 <IfModule mod_headers.c>
564 Header append Cache-Control "public"
565 Header append Vary User-Agent env=!dont-vary
569 <LocationMatch ^/(images|css|js)/>
570 # should pick up the default expire time from eg.conf...
571 <IfModule mod_deflate.c>
572 SetOutputFilter DEFLATE
573 BrowserMatch ^Mozilla/4 gzip-only-text/html
574 BrowserMatch ^Mozilla/4\.0[678] no-gzip
575 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
576 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
577 <IfModule mod_headers.c>
578 Header append Cache-Control "public"
579 Header append Vary User-Agent env=!dont-vary
584 PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
585 # Expire the HTML quickly since we're loading dynamic data for each page
587 ExpiresByType text/html "access plus 5 seconds"
589 # For use with embedded Content Cafe content
590 #SetEnv OILS_CONTENT_CAFE_USER 123
591 #SetEnv OILS_CONTENT_CAFE_PASS 456
592 # Consider copying/moving other added content configs
593 # (e.g. NOVELIST) into here or to an outer container shared by
594 # both /opac and /eg/opac since some are used in both places
598 # Note: the template processor will decline handling anything it does not
599 # have an explicit configuration for, which means it will fall back to
600 # Apache to serve the file. However, in the interest of speed, go ahead
601 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
602 # Add more exemptions as needed.
603 <LocationMatch ^/eg/.*(\.js|\.css|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
607 # ----------------------------------------------------------------------------------
608 # Some mod_deflate logging setup
609 # ----------------------------------------------------------------------------------
610 <IfModule mod_deflate.c>
611 DeflateFilterNote Input instream
612 DeflateFilterNote Output outstream
613 DeflateFilterNote Ratio ratio
615 LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
616 CustomLog /var/log/apache2/deflate_log deflate
622 SetHandler perl-script
623 PerlHandler OpenILS::WWW::IDL2js
628 <IfModule mod_headers.c>
629 Header append Cache-Control "public"
632 <IfModule mod_deflate.c>
633 SetOutputFilter DEFLATE
634 BrowserMatch ^Mozilla/4 gzip-only-text/html
635 BrowserMatch ^Mozilla/4\.0[678] no-gzip
636 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
637 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
638 <IfModule mod_headers.c>
639 Header append Vary User-Agent env=!dont-vary
644 # Uncomment the following to force SSL for everything. Note that this defeats caching
645 # and you will suffer a performance hit.
646 #RewriteCond %{HTTPS} off
647 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]