]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/apache_24/eg_vhost.conf.in
LP#1748466: Fix http -> https /eg/staff rewrite on Apache 2.4.
[Evergreen.git] / Open-ILS / examples / apache_24 / eg_vhost.conf.in
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 # ----------------------------------------------------------------------------------
5
6 # ----------------------------------------------------------------------------------
7 # Point / to the opac - if you have a custom skin or locale, point at it here
8 # ----------------------------------------------------------------------------------
9 RewriteRule ^/$ %{REQUEST_SCHEME}://%{HTTP_HOST}/eg/opac/home [R=301,L]
10
11 # ----------------------------------------------------------------------------------
12 # Redirect staff to the correct URL if they forget to include the final /
13 # ----------------------------------------------------------------------------------
14 RewriteRule ^/eg/staff$ https://%{HTTP_HOST}/eg/staff/ [R=301,L]
15
16 # ----------------------------------------------------------------------------------
17 # Point / to the IP address redirector
18 # ----------------------------------------------------------------------------------
19 #<LocationMatch ^/$>
20 #    SetHandler perl-script
21 #    PerlHandler OpenILS::WWW::Redirect
22 #    Options +ExecCGI
23 #    PerlSendHeader On
24 #    #PerlSetVar OILSRedirectSkin "default"
25 #    # OILSRedirectDepth defaults to the depth of the branch that the OPAC was directed to
26 #    #PerlSetVar OILSRedirectDepth "0"
27 #    #PerlSetVar OILSRedirectLocale "en-US"
28 #    # Use the template-toolkit opac
29 #    #PerlSetVar OILSRedirectTpac "true"
30 #    allow from all
31 #</LocationMatch>
32
33
34 # ----------------------------------------------------------------------------------
35 # Assign a default locale to the accessible OPAC
36 # ----------------------------------------------------------------------------------
37 RewriteRule ^/opac/extras/slimpac/start.html$ %{REQUEST_SCHEME}://%{HTTP_HOST}/opac/en-US/extras/slimpac/start.html [R=301,L]
38 RewriteRule ^/opac/extras/slimpac/advanced.html$ %{REQUEST_SCHEME}://%{HTTP_HOST}/opac/en-US/extras/slimpac/advanced.html [R=301,L]
39
40 # ----------------------------------------------------------------------------------
41 # Configure the gateway and translator
42 # ----------------------------------------------------------------------------------
43 OSRFGatewayConfig @sysconfdir@/opensrf_core.xml
44 OSRFTranslatorConfig @sysconfdir@/opensrf_core.xml
45 # Translator memcache server.  Default is localhost
46 # OSRFTranslatorCacheServer 127.0.0.1:11211
47
48
49 # ----------------------------------------------------------------------------------
50 # Added content plugin
51 # ----------------------------------------------------------------------------------
52 <Location /opac/extras/ac/>
53     SetHandler perl-script
54     PerlHandler OpenILS::WWW::AddedContent
55     Options +ExecCGI
56     PerlSendHeader On
57     Require all granted 
58 </Location>
59
60 # Lock clearing cache down to STAFF_LOGIN
61 <Location /opac/extras/ac/clearcache/>
62     PerlAccessHandler OpenILS::WWW::AccessHandler
63     PerlSetVar OILSAccessHandlerPermission "STAFF_LOGIN"
64 </Location>
65
66 # Autosuggest for searches
67 <Location /opac/extras/autosuggest>
68     SetHandler perl-script
69     PerlHandler OpenILS::WWW::AutoSuggest
70     PerlSendHeader On
71     Require all granted 
72 </Location>
73
74 # Flattener service
75 <Location /opac/extras/flattener>
76     SetHandler perl-script
77     PerlHandler OpenILS::WWW::FlatFielder
78     PerlSendHeader On
79     Require all granted 
80 </Location>
81
82 # ----------------------------------------------------------------------------------
83 # Replace broken cover images with a transparent GIF by default
84 # ----------------------------------------------------------------------------------
85 RewriteEngine ON
86 RewriteRule ^/opac/extras/ac/jacket/(small|medium|large)/$ \
87     /opac/images/blank.png [P,L]
88
89 <Location /opac/extras/ac/jacket>
90         ErrorDocument 404 /opac/images/blank.png
91 </Location>
92
93 # Uncomment one or more of these to have a "no image" image other than the blank
94 # image above.
95
96 # Note: There are no default images provided for these, you will need to provide
97 # your own "no image" image(s).
98
99 #<Location /opac/extras/ac/jacket/small>
100 #        ErrorDocument 404 /opac/images/noimage_small.png
101 #</Location>
102
103 #<Location /opac/extras/ac/jacket/medium>
104 #        ErrorDocument 404 /opac/images/noimage_medium.png
105 #</Location>
106
107 #<Location /opac/extras/ac/jacket/large>
108 #        ErrorDocument 404 /opac/images/noimage_large.png
109 #</Location>
110
111 # ----------------------------------------------------------------------------------
112 # Add the row ID (RID) and date so we can make unAPI happy
113 # ----------------------------------------------------------------------------------
114 RewriteCond %{QUERY_STRING} (^r|&r)=(\d+)
115 RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}]
116
117 # ----------------------------------------------------------------------------------
118 # Pull the locale from the URL
119 # ----------------------------------------------------------------------------------
120 RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
121 RewriteRule . - [E=locale:%1]
122
123 # ----------------------------------------------------------------------------------
124 # Rewrite JSPac->TPac with redirects
125 # ----------------------------------------------------------------------------------
126 # My Account
127 RewriteRule /opac/[^/]*/skin/default/xml/myopac.xml %{REQUEST_SCHEME}://%{HTTP_HOST}/eg/opac/myopac/main?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
128
129 # -----------------------------------------------------------------------------$
130 # Force HTTPS for /eg/circ/selfcheck
131 # -----------------------------------------------------------------------------$
132 RewriteCond %{HTTPS} off
133 RewriteRule ^(/eg/circ/selfcheck) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L]
134
135 # ----------------------------------------------------------------------------------
136 # For sanity reasons, default indexes to Off
137 # ----------------------------------------------------------------------------------
138 Options -Indexes
139
140 # ----------------------------------------------------------------------------------
141 # Configure the OPAC
142 # ----------------------------------------------------------------------------------
143 <LocationMatch /opac/>
144     SSILegacyExprParser on
145     AddType application/xhtml+xml .xml
146    
147     # - configure mod_xmlent
148     XMLEntStripPI "yes"
149     XMLEntEscapeScript "no"
150     XMLEntStripComments "yes"
151     XMLEntContentType "text/html; charset=utf-8"
152     # forces quirks mode which we want for now
153     XMLEntStripDoctype "yes" 
154
155     # - set up the include handlers
156     Options +Includes
157     AddOutputFilter INCLUDES .xsl
158     AddOutputFilter INCLUDES;XMLENT .xml
159                     
160     SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
161     
162     # This gives you the option to configure a different host to serve OPAC images from
163     # Specify the hostname (without protocol) and path to the images.  Protocol will
164     # be determined at runtime
165     #SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=static.example.org/opac/
166
167     # In addition to loading images from a static host, you can also load CSS and/or
168     # Javascript from a static host or hosts. Protocol will be determined at runtime
169     # and/or by configuration options immediately following.
170     #SetEnvIf Request_URI ".*" OILS_OPAC_CSS_HOST=static.example.org/opac/
171     #SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=static.example.org/opac/
172
173     # If you are not able to serve static content via https and 
174     # wish to force http:// (and are comfortable with mixed-content
175     # warnings in client browsers), set this:
176     #SetEnvIf Request_URI ".*" OILS_OPAC_STATIC_PROTOCOL=http
177
178     # If you would prefer to fall back to your non-static servers for 
179     # https pages, avoiding mixed-content warnings in client browsers
180     # and are willing to accept some increased server load, set this:
181     #SetEnvIf Request_URI ".*" OILS_OPAC_BYPASS_STATIC_FOR_HTTPS=yes
182
183     # Specify a ChiliFresh account to integrate their services with the OPAC
184     #SetEnv OILS_CHILIFRESH_ACCOUNT
185     #SetEnv OILS_CHILIFRESH_PROFILE
186     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
187     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
188
189     # Specify the initial script URL for Novelist (containing account credentials, etc.)
190     #SetEnv OILS_NOVELIST_URL
191     #
192
193     # Uncomment to force SSL any time a patron is logged in.  This protects 
194     # authentication tokens.  Left commented out for backwards compat for now.
195     #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
196
197     # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js
198     #SetEnv OILS_OPAC_COMBINED_JS 1
199
200 </LocationMatch>
201
202 <Location /opac/>
203     # ----------------------------------------------------------------------------------
204     # Some mod_deflate fun
205     # ----------------------------------------------------------------------------------
206     <IfModule mod_deflate.c>
207         SetOutputFilter DEFLATE
208
209         BrowserMatch ^Mozilla/4 gzip-only-text/html
210         BrowserMatch ^Mozilla/4\.0[678] no-gzip
211         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
212
213         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
214
215         <IfModule mod_headers.c>
216             Header append Vary User-Agent env=!dont-vary
217         </IfModule>
218     </IfModule>
219
220 </Location>
221
222 <Location //opac/>
223     # ----------------------------------------------------------------------------------
224     # Some mod_deflate fun
225     # ----------------------------------------------------------------------------------
226     <IfModule mod_deflate.c>
227         SetOutputFilter DEFLATE
228
229         BrowserMatch ^Mozilla/4 gzip-only-text/html
230         BrowserMatch ^Mozilla/4\.0[678] no-gzip
231         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
232
233         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
234
235         <IfModule mod_headers.c>
236             Header append Vary User-Agent env=!dont-vary
237         </IfModule>
238     </IfModule>
239
240 </Location>
241
242 # ----------------------------------------------------------------------------------
243 # Force SSL on the OPAC's "My Account" page
244 # ----------------------------------------------------------------------------------
245 <LocationMatch .*/myopac.xml>
246     SSLRequireSSL
247 </LocationMatch>
248
249 RewriteCond %{QUERY_STRING} locale=([^&]*)
250 RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ %{REQUEST_SCHEME}://%{HTTP_HOST}/opac/%1/extras/slimpac/$1? [redirect]
251 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
252     AddOutputFilter INCLUDES;XMLENT .html
253 </LocationMatch>
254
255 # ----------------------------------------------------------------------------------
256 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
257 # ----------------------------------------------------------------------------------
258 RewriteCond %{HTTP:Accept-Language} ^([a-z]{2}-[A-Z]{2})$
259 # Default to en-US if we haven't matched a locale of the form xx-YY 
260 RewriteRule .? - [S=4]
261 RewriteRule ^/xul/      -       [E=locale:en-US]
262 RewriteRule ^/reports/  -       [E=locale:en-US]
263 RewriteRule .? - [E=locale:en-US]
264 RewriteRule .? - [S=3]
265 # Otherwise, set our real locale
266 RewriteRule ^/xul/      -       [E=locale:%{HTTP:Accept-Language}]
267 RewriteRule ^/reports/  -       [E=locale:%{HTTP:Accept-Language}]
268 RewriteRule .? - [E=locale:%{HTTP:Accept-Language}]
269
270 <LocationMatch /xul/.*\.x?html$>
271     SSILegacyExprParser on
272     Options +Includes
273     XMLEntEscapeScript "no"
274     XMLEntStripComments "yes"
275     XMLEntStripPI "yes"
276     XMLEntStripDoctype "yes"
277     XMLEntContentType "text/html; charset=utf-8"
278     AddOutputFilter INCLUDES;XMLENT .xhtml
279     AddOutputFilter INCLUDES;XMLENT .html
280     SetEnv no-gzip
281     Require all granted 
282 </LocationMatch>
283
284
285 <LocationMatch /xul/.*\.xul$>
286     SSILegacyExprParser on
287     Options +Includes
288     XMLEntContentType "application/vnd.mozilla.xul+xml"
289     AddOutputFilter INCLUDES;XMLENT .xul
290     SetEnv no-gzip
291     Require all granted 
292 </LocationMatch>
293
294 # ----------------------------------------------------------------------------------
295 # Supercat feeds
296 # ----------------------------------------------------------------------------------
297 <Location /opac/extras/oisbn>
298     SetHandler perl-script
299     PerlHandler OpenILS::WWW::SuperCat::oisbn
300     Options +ExecCGI
301     PerlSendHeader On
302     Require all granted 
303 </Location>
304 <Location /opac/extras/supercat>
305     SetHandler perl-script
306     PerlHandler OpenILS::WWW::SuperCat::supercat
307     Options +ExecCGI
308     PerlSendHeader On
309     Require all granted 
310 </Location>
311 <Location /opac/extras/unapi>
312     SetHandler perl-script
313     PerlHandler OpenILS::WWW::SuperCat::unapi
314     Options +ExecCGI
315     PerlSendHeader On
316     Require all granted 
317 </Location>
318 <Location /opac/extras/feed/bookbag>
319     SetHandler perl-script
320     PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
321     Options +ExecCGI
322     PerlSendHeader On
323     Require all granted 
324 </Location>
325 <Location /opac/extras/opensearch>
326     SetHandler perl-script
327     PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
328     Options +ExecCGI
329     PerlSendHeader On
330     Require all granted 
331 </Location>
332 <Location /opac/extras/sru>
333     SetHandler perl-script
334     PerlHandler OpenILS::WWW::SuperCat::sru_search
335     Options +ExecCGI
336     PerlSendHeader On
337     Require all granted 
338 </Location>
339 <Location /opac/extras/sru_auth>
340     SetHandler perl-script
341     PerlHandler OpenILS::WWW::SuperCat::sru_auth_search
342     Options +ExecCGI
343     PerlSendHeader On
344     Require all granted 
345 </Location>
346 <Location /opac/extras/feed/freshmeat>
347     SetHandler perl-script
348     PerlHandler OpenILS::WWW::SuperCat::changes_feed
349     Options +ExecCGI
350     PerlSendHeader On
351     Require all granted 
352 </Location>
353 <Location /opac/extras/browse>
354     SetHandler perl-script
355     PerlHandler OpenILS::WWW::SuperCat::string_browse
356     Options +ExecCGI
357     PerlSendHeader On
358     Require all granted 
359 </Location>     
360 <Location /opac/extras/startwith>
361     SetHandler perl-script
362     PerlHandler OpenILS::WWW::SuperCat::string_startwith
363     Options +ExecCGI
364     PerlSendHeader On
365     Require all granted 
366 </Location>     
367         
368 # ----------------------------------------------------------------------------------
369 # Module for displaying OpenSRF API documentation
370 # ----------------------------------------------------------------------------------
371 <Location /opac/extras/docgen.xsl>
372     AddOutputFilter INCLUDES .xsl
373 </Location>
374
375 # ----------------------------------------------------------------------------------
376 # Module for processing staff-client offline scripts lives here
377 # ----------------------------------------------------------------------------------
378 <Directory "@localstatedir@/cgi-bin/offline">
379     AddHandler cgi-script .pl
380     AllowOverride None
381     Options +ExecCGI
382     Require all granted 
383 </Directory>
384         
385         
386 # ----------------------------------------------------------------------------------
387 # XXX Note, it's important to explicitly set the JSON encoding style 
388 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change 
389 # with OpenSRF 1.0
390 # ----------------------------------------------------------------------------------
391 # OpenSRF JSON legacy gateway
392 # ----------------------------------------------------------------------------------
393 <Location /gateway>
394     SetHandler osrf_json_gateway_module
395     OSRFGatewayLegacyJSON "true"
396     Require all granted 
397 </Location>
398 # ----------------------------------------------------------------------------------
399 # New-style OpenSRF JSON gateway
400 # ----------------------------------------------------------------------------------
401 <Location /osrf-gateway-v1>
402     SetHandler osrf_json_gateway_module
403     OSRFGatewayLegacyJSON "false"
404     Require all granted 
405 </Location>
406
407 # ----------------------------------------------------------------------------------
408 # OpenSRF-over-HTTP translator
409 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
410 # ----------------------------------------------------------------------------------
411 <Location /osrf-http-translator>
412     SetHandler osrf_http_translator_module
413     Require all granted 
414 </Location>
415
416 # ----------------------------------------------------------------------------------
417 # The exporter lives here
418 # ----------------------------------------------------------------------------------
419 <Location /exporter>
420     SetHandler perl-script
421     AuthType Basic
422     AuthName "Exporter Login"
423     PerlOptions +GlobalRequest
424     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
425     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
426     Require valid-user
427     PerlHandler OpenILS::WWW::Exporter
428     Options +ExecCGI
429     PerlSendHeader On
430 </Location>
431
432 <Location /opac/extras/merge_template>
433     SetHandler perl-script
434     AuthType Basic
435     AuthName "Batch Update Login"
436     PerlOptions +GlobalRequest
437     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
438     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
439     Require valid-user
440     PerlHandler OpenILS::WWW::TemplateBatchBibUpdate
441     PerlSendHeader On
442     Options +ExecCGI
443 </Location>
444
445 <Location /opac/extras/circ>
446     AuthType Basic
447     AuthName "Circ Extras Login"
448     PerlOptions +GlobalRequest
449     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
450     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
451     Require valid-user
452     Options +ExecCGI
453     PerlSendHeader On
454 </Location>
455
456 <Location /collections>
457     SetHandler perl-script
458     AuthType Basic
459     AuthName "Collections Login"
460     PerlOptions +GlobalRequest
461     PerlSetVar OILSProxyPermissions "money.collections_tracker.create"
462     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
463     Require valid-user
464     Options +ExecCGI
465     PerlSendHeader On
466 </Location>
467
468 # ----------------------------------------------------------------------------------
469 # Protect Standalone/Offline mode files from public view
470 # ----------------------------------------------------------------------------------
471 <Location /standalone/>
472     AuthType Basic
473     AuthName "Standalone Mode Login"
474     PerlOptions +GlobalRequest
475     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
476     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
477     Require valid-user
478     PerlSendHeader On
479     allow from all
480     SSLRequireSSL
481 </Location>
482
483 # ----------------------------------------------------------------------------------
484 # Reporting output lives here
485 # ----------------------------------------------------------------------------------
486 <Location /reporter/>
487     AuthType Basic
488     AuthName "Report Login"
489     PerlOptions +GlobalRequest
490     PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
491     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
492     Require valid-user
493     Options +ExecCGI
494     PerlSendHeader On
495 </Location>
496
497 # ----------------------------------------------------------------------------------
498 # Reports GUI
499 # ----------------------------------------------------------------------------------
500 <LocationMatch /reports.*\.x?html>
501     SSILegacyExprParser on
502     Options +Includes
503     XMLEntContentType "text/html; charset=utf-8"
504     AddOutputFilter INCLUDES;XMLENT .xhtml
505     AddOutputFilter INCLUDES;XMLENT .html
506 </LocationMatch>
507
508 <LocationMatch /reports>
509     SSILegacyExprParser on
510     Options +Includes
511     AddOutputFilter INCLUDES;XMLENT .xhtml
512 </LocationMatch>
513
514 # capture locale CGI param for /reports/fm_IDL.xml
515 RewriteCond %{REQUEST_URI} ^/reports/fm_IDL.xml
516 RewriteCond %{QUERY_STRING} locale=([^&;]*)
517 RewriteRule . - [E=locale:%1]
518
519 <LocationMatch /reports/fm_IDL.xml>
520     IDLChunkStripPI "yes"
521     IDLChunkEscapeScript "no"
522     IDLChunkStripComments "yes"
523     IDLChunkStripDoctype "yes"
524     IDLChunkContentType "application/xml; charset=utf-8"
525     AddOutputFilter INCLUDES;IDLCHUNK .xml
526     SetEnv no-gzip
527 </LocationMatch>
528
529 # ----------------------------------------------------------------------------------
530 # EDI Message viewer
531 # ----------------------------------------------------------------------------------
532 <Location /edi>
533     SetHandler perl-script
534     PerlHandler OpenILS::WWW::EDI
535     Options +ExecCGI
536     PerlSendHeader On
537     Require all granted 
538 </Location>     
539
540 # ----------------------------------------------------------------------------------
541 # XML-RPC gateway
542 # ----------------------------------------------------------------------------------
543 <Location /xml-rpc>
544     SetHandler perl-script
545     PerlHandler OpenILS::WWW::XMLRPCGateway
546     Options +ExecCGI
547     PerlSendHeader On
548     Require all granted 
549     <IfModule mod_headers.c>
550         Header onsuccess set Cache-Control no-cache
551     </IfModule>
552 </Location>
553
554 # ----------------------------------------------------------------------------------
555 # Conify - next-generation Evergreen administration interface
556 # ----------------------------------------------------------------------------------
557 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
558 <Location /conify>
559     SSILegacyExprParser on
560     Options +Includes
561     XMLEntStripPI "yes"
562     XMLEntEscapeScript "no"
563     XMLEntStripComments "no"
564     XMLEntContentType "text/html; charset=utf-8"
565     AddOutputFilter INCLUDES;XMLENT .html
566  
567     AuthType Basic
568     AuthName "Dojo Admin Login"
569     PerlOptions +GlobalRequest
570     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
571     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
572     Require valid-user
573     Options +ExecCGI
574     PerlSendHeader On
575 </Location>
576
577 # ----------------------------------------------------------------------------------
578 # The PhoneList lives here
579 # ----------------------------------------------------------------------------------
580 <Location /phonelist>
581     SetHandler perl-script
582     AuthType Basic
583     AuthName "PhoneList Login"
584     Require valid-user
585     PerlOptions +GlobalRequest
586     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
587     PerlHandler OpenILS::WWW::PhoneList
588     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
589     Options +ExecCGI
590     PerlSendHeader On
591     <IfModule mod_headers.c>
592         Header onsuccess set Cache-Control no-cache
593     </IfModule>
594 </Location>
595 <Location /vandelay-upload>
596     SetHandler perl-script
597     PerlHandler OpenILS::WWW::Vandelay::spool_marc
598     Options +ExecCGI
599     Require all granted 
600 </Location>
601
602 # OpenURL 0.1 searching based on OpenSearch
603 RewriteMap openurl prg:@bindir@/openurl_map.pl
604 RewriteCond %{QUERY_STRING} (^.*$)
605 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
606
607
608
609 # General Evergreen web template processor
610 <Location /eg>
611     SetHandler perl-script
612     PerlHandler OpenILS::WWW::EGWeb
613     Options +ExecCGI
614     PerlSendHeader On
615     Require all granted 
616
617     PerlSetVar OILSWebBasePath "/eg"
618     PerlSetVar OILSWebWebDir "@localstatedir@/web"
619     PerlSetVar OILSWebDefaultTemplateExtension "tt2"
620
621     # Port Apache listens on for HTTP traffic.  Used for HTTP requests 
622     # routed from Perl handlers back to the same Apache instance, like
623     # added content requests.  Use this when running Apache with a 
624     # non-standard port, typical with a proxy setup.  Defaults to "80".
625     # PerlSetVar OILSWebInternalHTTPPort "7080"
626
627     # Enable Template-Toolkit error debugging messages (apache error log)
628     PerlSetVar OILSWebDebugTemplate "false"
629     # local cache of compiled Template Toolkit templates
630     PerlSetVar OILSWebCompiledTemplateCache "/tmp/eg_template_cache"
631     # template TTL - how long, in seconds, that Template Toolkit
632     # waits to check for updated template files
633     #PerlSetVar OILSWebTemplateStatTTL 60
634
635     # -------------------------------------------------------
636     # Media Prefix.  In the 3rd example, the protocol (http) is enforced
637     #PerlSetVar OILSWebMediaPrefix "/media"
638     #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
639     #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
640
641     # Locale messages files:
642     #
643     # These appear in pairs; the first represents the user agent
644     # Accept-Language header locale, and the second represents
645     # the fully-qualified path for the corresponding PO file that
646     # contains the messages.
647     #
648     # If you enable two or more locales, then users will be able to
649     # select their preferred locale from a locale picker in the TPAC.
650     #
651     #PerlAddVar OILSWebLocale "en"
652     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/opac/messages.en.po"
653     #PerlAddVar OILSWebLocale "en_ca"
654     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/opac/en-CA.po"
655     #PerlAddVar OILSWebLocale "fr_ca"
656     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/opac/fr-CA.po"
657
658     # Set the default locale: defaults to en-US
659     #PerlAddVar OILSWebDefaultLocale "fr_ca"
660     
661     # Templates will be loaded from the following paths in reverse order.
662     PerlAddVar OILSWebTemplatePath "@localstatedir@/templates"
663     #PerlAddVar OILSWebTemplatePath "@localstatedir@/templates_localskin"
664
665     #-------------------------------------------------
666     # Added Content Configuration
667     #-------------------------------------------------
668     # Content Cafe
669     #SetEnv OILS_CONTENT_CAFE_USER MYUSER
670     #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
671     
672     # LibraryThing
673     #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
674     #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
675     
676     # ChiliFresh
677     #SetEnv OILS_CHILIFRESH_ACCOUNT
678     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
679     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
680
681     # Novelist
682     # SetEnv OILS_NOVELIST_URL http://imageserver.ebscohost.com/novelistselect/ns2init.js
683     # SetEnv OILS_NOVELIST_PROFILE <profile>
684     # SetEnv OILS_NOVELIST_PASSWORD <password>
685
686     #-------------------------------------------------
687
688     <IfModule mod_deflate.c>
689         SetOutputFilter DEFLATE
690         BrowserMatch ^Mozilla/4 gzip-only-text/html
691         BrowserMatch ^Mozilla/4\.0[678] no-gzip
692         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
693         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
694         <IfModule mod_headers.c>
695             Header append Cache-Control "public"
696             Header append Vary User-Agent env=!dont-vary
697         </IfModule>
698     </IfModule>
699 </Location>
700 <LocationMatch ^/(images|css|js)/>
701     # should pick up the default expire time from eg.conf...
702     <IfModule mod_deflate.c>
703         SetOutputFilter DEFLATE
704         BrowserMatch ^Mozilla/4 gzip-only-text/html
705         BrowserMatch ^Mozilla/4\.0[678] no-gzip
706         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
707         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
708         <IfModule mod_headers.c>
709             Header append Cache-Control "public"
710             Header append Vary User-Agent env=!dont-vary
711         </IfModule>
712     </IfModule>
713 </LocationMatch>
714 <Location /eg/opac>
715     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
716     # Expire the HTML quickly since we're loading dynamic data for each page
717     ExpiresActive On
718     ExpiresByType text/html "access plus 5 seconds"
719 </Location>
720 <Location /eg/kpac>
721     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader"
722     PerlSetVar KPacConfigFile "@sysconfdir@/kpac.xml.example"
723     ExpiresActive On
724     ExpiresByType text/html "access plus 5 seconds"
725 </Location>
726
727 # Note: the template processor will decline handling anything it does not
728 # have an explicit configuration for, which means it will fall back to 
729 # Apache to serve the file.  However, in the interest of speed, go ahead 
730 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
731 # Add more exemptions as needed.
732 <LocationMatch ^/eg/.*(\.js|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
733     SetHandler None
734 </LocationMatch>
735
736 # ----------------------------------------------------------------------------------
737 # Some mod_deflate setup
738 # ----------------------------------------------------------------------------------
739 <IfModule mod_deflate.c>
740
741     ## optional logging for mod_deflate debugging
742     ##DeflateFilterNote Input instream
743     ##DeflateFilterNote Output outstream
744     ##DeflateFilterNote Ratio ratio
745     ##
746     ##LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
747     ##CustomLog /var/log/apache2/deflate_log deflate
748
749     # There are problems with XMLENT and mod_deflate - so lets disable it
750     # This is where we don't have a pre-existing LocationMatch directive earlier
751     <LocationMatch /opac/.*\.xml$>
752         SetEnv no-gzip
753     </LocationMatch>
754     <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
755         SetEnv no-gzip
756     </LocationMatch>
757     <LocationMatch /reports/.*\.xhtml$>
758         SetEnv no-gzip
759     </LocationMatch>
760     <LocationMatch /conify/.*\.html$>
761         SetEnv no-gzip
762     </LocationMatch>
763 </IfModule>
764
765
766 <Location /IDL2js>
767
768     SetHandler perl-script
769     PerlHandler OpenILS::WWW::IDL2js
770     Options +ExecCGI
771     PerlSendHeader On
772     Require all granted 
773
774     <IfModule mod_headers.c>
775         Header append Cache-Control "public"
776     </IFModule>
777
778     <IfModule mod_deflate.c>
779         SetOutputFilter DEFLATE
780         BrowserMatch ^Mozilla/4 gzip-only-text/html
781         BrowserMatch ^Mozilla/4\.0[678] no-gzip
782         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
783         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
784         <IfModule mod_headers.c>
785             Header append Vary User-Agent env=!dont-vary
786         </IfModule>
787     </IfModule>
788 </Location>
789
790 <LocationMatch /eg/staff/>
791     Options -MultiViews
792     PerlSetVar OILSWebStopAtIndex "true"
793
794     RewriteCond %{HTTPS} off
795     RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]
796
797     # sample staff-specific translation files
798     #PerlAddVar OILSWebLocale "en_ca"
799     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/staff/en-CA.po"
800     #PerlAddVar OILSWebLocale "fr_ca"
801     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/staff/fr-CA.po"
802 </LocationMatch>
803
804 <Location /js/>
805     <IfModule mod_headers.c>
806         Header append Cache-Control "public"
807     </IFModule>
808     <IfModule mod_deflate.c>
809         SetOutputFilter DEFLATE
810         BrowserMatch ^Mozilla/4 gzip-only-text/html
811         BrowserMatch ^Mozilla/4\.0[678] no-gzip
812         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
813         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
814         <IfModule mod_headers.c>
815             Header append Vary User-Agent env=!dont-vary
816         </IfModule>
817     </IfModule>
818 </Location>
819
820
821 # Uncomment the following to force SSL for everything. Note that this defeats caching
822 # and you will suffer a performance hit.
823 #RewriteCond %{HTTPS} off
824 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]