]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/examples/apache/eg_vhost.conf
4e2ee8fed66f8a5bcaaee8ad31fbbdc697eec941
[working/Evergreen.git] / Open-ILS / examples / apache / eg_vhost.conf
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 RedirectMatch 301 ^/$ /opac/en-US/skin/default/xml/index.xml
10
11 # ----------------------------------------------------------------------------------
12 # Point / to the IP address redirector
13 # ----------------------------------------------------------------------------------
14 #<LocationMatch ^/$>
15 #    SetHandler perl-script
16 #    PerlHandler OpenILS::WWW::Redirect
17 #    Options +ExecCGI
18 #    PerlSendHeader On
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"
25 #    allow from all
26 #</LocationMatch>
27
28
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
34
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
41
42
43 # ----------------------------------------------------------------------------------
44 # Added content plugin
45 # ----------------------------------------------------------------------------------
46 <Location /opac/extras/ac/>
47     SetHandler perl-script
48     PerlHandler OpenILS::WWW::AddedContent
49     Options +ExecCGI
50     PerlSendHeader On
51     allow from all
52 </Location>
53
54 # Autosuggest for searches
55 <Location /opac/extras/autosuggest>
56     SetHandler perl-script
57     PerlHandler OpenILS::WWW::AutoSuggest
58     PerlSendHeader On
59     Allow from All
60 </Location>
61
62 # Flattener service
63 <Location /opac/extras/flattener>
64     SetHandler perl-script
65     PerlHandler OpenILS::WWW::FlatFielder
66     PerlSendHeader On
67     Allow from All
68 </Location>
69
70 # ----------------------------------------------------------------------------------
71 # Replace broken cover images with a transparent GIF by default
72 # ----------------------------------------------------------------------------------
73 RewriteEngine ON
74 RewriteRule ^/opac/extras/ac/jacket/(small|medium|large)/$ \
75     /opac/images/blank.png [P,L]
76
77 # ----------------------------------------------------------------------------------
78 # Add the row ID (RID) and date so we can make unAPI happy
79 # ----------------------------------------------------------------------------------
80 RewriteCond %{QUERY_STRING} (^r|&r)=(\d+)
81 RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}]
82
83 # ----------------------------------------------------------------------------------
84 # Pull the locale from the URL
85 # ----------------------------------------------------------------------------------
86 RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
87 RewriteRule . - [E=locale:%1]
88
89 # ----------------------------------------------------------------------------------
90 # For sanity reasons, default indexes to Off
91 # ----------------------------------------------------------------------------------
92 Options -Indexes
93
94 # ----------------------------------------------------------------------------------
95 # Configure the OPAC
96 # ----------------------------------------------------------------------------------
97 <LocationMatch /opac/>
98     AddType application/xhtml+xml .xml
99    
100     # - configure mod_xmlent
101     XMLEntStripPI "yes"
102     XMLEntEscapeScript "no"
103     XMLEntStripComments "yes"
104     XMLEntContentType "text/html; charset=utf-8"
105     # forces quirks mode which we want for now
106     XMLEntStripDoctype "yes" 
107
108     # - set up the include handlers
109     Options +Includes
110     AddOutputFilter INCLUDES .xsl
111     AddOutputFilter INCLUDES;XMLENT .xml
112                     
113     SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
114     
115     # This gives you the option to configure a different host to serve OPAC images from
116     # Specify the hostname (without protocol) and path to the images.  Protocol will
117     # be determined at runtime
118     #SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=static.example.org/opac/
119
120     # In addition to loading images from a static host, you can also load CSS and/or
121     # Javascript from a static host or hosts. Protocol will be determined at runtime
122     # and/or by configuration options immediately following.
123     #SetEnvIf Request_URI ".*" OILS_OPAC_CSS_HOST=static.example.org/opac/
124     #SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=static.example.org/opac/
125
126     # If you are not able to serve static content via https and 
127     # wish to force http:// (and are comfortable with mixed-content
128     # warnings in client browsers), set this:
129     #SetEnvIf Request_URI ".*" OILS_OPAC_STATIC_PROTOCOL=http
130
131     # If you would prefer to fall back to your non-static servers for 
132     # https pages, avoiding mixed-content warnings in client browsers
133     # and are willing to accept some increased server load, set this:
134     #SetEnvIf Request_URI ".*" OILS_OPAC_BYPASS_STATIC_FOR_HTTPS=yes
135
136     # Specify a ChiliFresh account to integrate their services with the OPAC
137     #SetEnv OILS_CHILIFRESH_ACCOUNT
138     #SetEnv OILS_CHILIFRESH_PROFILE
139     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
140     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
141
142     # Specify the initial script URL for Novelist (containing account credentials, etc.)
143     #SetEnv OILS_NOVELIST_URL
144     #
145
146     # Uncomment to force SSL any time a patron is logged in.  This protects 
147     # authentication tokens.  Left commented out for backwards compat for now.
148     #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
149
150     # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js
151     #SetEnv OILS_OPAC_COMBINED_JS 1
152
153 </LocationMatch>
154
155 <Location /opac/>
156     # ----------------------------------------------------------------------------------
157     # Some mod_deflate fun
158     # ----------------------------------------------------------------------------------
159     <IfModule mod_deflate.c>
160         SetOutputFilter DEFLATE
161
162         BrowserMatch ^Mozilla/4 gzip-only-text/html
163         BrowserMatch ^Mozilla/4\.0[678] no-gzip
164         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
165
166         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
167
168         <IfModule mod_headers.c>
169             Header append Vary User-Agent env=!dont-vary
170         </IfModule>
171     </IfModule>
172
173 </Location>
174
175 <Location //opac/>
176     # ----------------------------------------------------------------------------------
177     # Some mod_deflate fun
178     # ----------------------------------------------------------------------------------
179     <IfModule mod_deflate.c>
180         SetOutputFilter DEFLATE
181
182         BrowserMatch ^Mozilla/4 gzip-only-text/html
183         BrowserMatch ^Mozilla/4\.0[678] no-gzip
184         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
185
186         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
187
188         <IfModule mod_headers.c>
189             Header append Vary User-Agent env=!dont-vary
190         </IfModule>
191     </IfModule>
192
193 </Location>
194
195 # ----------------------------------------------------------------------------------
196 # Force SSL on the OPAC's "My Account" page
197 # ----------------------------------------------------------------------------------
198 <LocationMatch .*/myopac.xml>
199     SSLRequireSSL
200 </LocationMatch>
201
202 <LocationMatch /opac/extras/>
203     # Force to en-US for now to satisfy bbags.xml
204     SetEnv locale en-US
205     Options +Includes
206     AddOutputFilter INCLUDES .xml
207     AddType application/xhtml+xml .xml
208 </LocationMatch>
209
210 RewriteCond %{QUERY_STRING} locale=([^&]*)
211 RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
212 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
213     AddOutputFilter INCLUDES;XMLENT .html
214 </LocationMatch>
215
216 # ----------------------------------------------------------------------------------
217 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
218 # ----------------------------------------------------------------------------------
219 RewriteCond %{HTTP:Accept-Language} ([a-z]{2}-[A-Z]{2})
220 RewriteRule ^/xul/      -       [E=locale:%1]
221 RewriteRule ^/reports/  -       [E=locale:%1]
222
223 # Default to en-US if we haven't matched a locale of the form xx-YY 
224 RewriteCond %{HTTP:Accept-Language} !([a-z]{2}-[A-Z]{2})
225 RewriteRule ^/xul/      -       [E=locale:en-US]
226 RewriteRule ^/reports/  -       [E=locale:en-US]
227
228 # Default to en-US if we are just given en
229 RewriteCond %{ENV:locale} ^$ [OR]
230 RewriteCond %{ENV:locale} ^en$
231 RewriteRule . - [E=locale:en-US]
232
233 <LocationMatch /xul/.*\.x?html$>
234     Options +Includes
235     XMLEntEscapeScript "no"
236     XMLEntStripComments "yes"
237     XMLEntStripPI "yes"
238     XMLEntStripDoctype "yes"
239     XMLEntContentType "text/html; charset=utf-8"
240     AddOutputFilter INCLUDES;XMLENT .xhtml
241     AddOutputFilter INCLUDES;XMLENT .html
242     SetEnv no-gzip
243     allow from all
244 </LocationMatch>
245
246
247 <LocationMatch /xul/.*\.xul$>
248     Options +Includes
249     XMLEntContentType "application/vnd.mozilla.xul+xml"
250     AddOutputFilter INCLUDES;XMLENT .xul
251     SetEnv no-gzip
252     allow from all
253 </LocationMatch>
254
255 # ----------------------------------------------------------------------------------
256 # Self-serve password interface
257 # ----------------------------------------------------------------------------------
258 <Location /opac/password>
259     SetHandler perl-script
260     PerlHandler OpenILS::WWW::PasswordReset::password_reset
261     Options +ExecCGI
262     PerlSendHeader On
263     allow from all
264
265     # Force clients to use HTTPS
266     RewriteCond %{HTTPS} !=on [NC]
267     RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
268 </Location>
269
270 # ----------------------------------------------------------------------------------
271 # Supercat feeds
272 # ----------------------------------------------------------------------------------
273 <Location /opac/extras/oisbn>
274     SetHandler perl-script
275     PerlHandler OpenILS::WWW::SuperCat::oisbn
276     Options +ExecCGI
277     PerlSendHeader On
278     allow from all
279 </Location>
280 <Location /opac/extras/supercat>
281     SetHandler perl-script
282     PerlHandler OpenILS::WWW::SuperCat::supercat
283     Options +ExecCGI
284     PerlSendHeader On
285     allow from all
286 </Location>
287 <Location /opac/extras/unapi>
288     SetHandler perl-script
289     PerlHandler OpenILS::WWW::SuperCat::unapi
290     Options +ExecCGI
291     PerlSendHeader On
292     allow from all
293 </Location>
294 <Location /opac/extras/feed/bookbag>
295     SetHandler perl-script
296     PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
297     Options +ExecCGI
298     PerlSendHeader On
299     allow from all
300 </Location>
301 <Location /opac/extras/opensearch>
302     SetHandler perl-script
303     PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
304     Options +ExecCGI
305     PerlSendHeader On
306     allow from all
307 </Location>
308 <Location /opac/extras/sru>
309     SetHandler perl-script
310     PerlHandler OpenILS::WWW::SuperCat::sru_search
311     Options +ExecCGI
312     PerlSendHeader On
313     allow from all
314 </Location>
315 <Location /opac/extras/sru_auth>
316     SetHandler perl-script
317     PerlHandler OpenILS::WWW::SuperCat::sru_auth_search
318     Options +ExecCGI
319     PerlSendHeader On
320     allow from all
321 </Location>
322 <Location /opac/extras/feed/freshmeat>
323     SetHandler perl-script
324     PerlHandler OpenILS::WWW::SuperCat::changes_feed
325     Options +ExecCGI
326     PerlSendHeader On
327     allow from all
328 </Location>
329 <Location /opac/extras/browse>
330     SetHandler perl-script
331     PerlHandler OpenILS::WWW::SuperCat::string_browse
332     Options +ExecCGI
333     PerlSendHeader On
334     allow from all
335 </Location>     
336 <Location /opac/extras/startwith>
337     SetHandler perl-script
338     PerlHandler OpenILS::WWW::SuperCat::string_startwith
339     Options +ExecCGI
340     PerlSendHeader On
341     allow from all
342 </Location>     
343         
344 # ----------------------------------------------------------------------------------
345 # Module for displaying OpenSRF API documentation
346 # ----------------------------------------------------------------------------------
347 <Location /opac/extras/docgen.xsl>
348     AddOutputFilter INCLUDES .xsl
349 </Location>
350
351 # ----------------------------------------------------------------------------------
352 # Module for processing staff-client offline scripts lives here
353 # ----------------------------------------------------------------------------------
354 <Directory "/openils/var/cgi-bin/offline">
355     AddHandler cgi-script .pl
356     AllowOverride None
357     Options +ExecCGI
358     allow from all
359 </Directory>
360         
361         
362 # ----------------------------------------------------------------------------------
363 # XXX Note, it's important to explicitly set the JSON encoding style 
364 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change 
365 # with OpenSRF 1.0
366 # ----------------------------------------------------------------------------------
367 # OpenSRF JSON legacy gateway
368 # ----------------------------------------------------------------------------------
369 <Location /gateway>
370     SetHandler osrf_json_gateway_module
371     OSRFGatewayLegacyJSON "true"
372     allow from all
373 </Location>
374 # ----------------------------------------------------------------------------------
375 # New-style OpenSRF JSON gateway
376 # ----------------------------------------------------------------------------------
377 <Location /osrf-gateway-v1>
378     SetHandler osrf_json_gateway_module
379     OSRFGatewayLegacyJSON "false"
380     allow from all
381 </Location>
382
383 # ----------------------------------------------------------------------------------
384 # OpenSRF-over-HTTP translator
385 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
386 # ----------------------------------------------------------------------------------
387 <Location /osrf-http-translator>
388     SetHandler osrf_http_translator_module
389     allow from all
390 </Location>
391
392 # ----------------------------------------------------------------------------------
393 # The exporter lives here
394 # ----------------------------------------------------------------------------------
395 <Location /exporter>
396     SetHandler perl-script
397     AuthType Basic
398     AuthName "Exporter Login"
399     PerlOptions +GlobalRequest
400     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
401     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
402     require valid-user
403     PerlHandler OpenILS::WWW::Exporter
404     Options +ExecCGI
405     PerlSendHeader On
406     allow from all
407 </Location>
408
409 <Location /opac/extras/merge_template>
410     SetHandler perl-script
411     AuthType Basic
412     AuthName "Batch Update Login"
413     PerlOptions +GlobalRequest
414     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
415     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
416     require valid-user
417     PerlHandler OpenILS::WWW::TemplateBatchBibUpdate
418     PerlSendHeader On
419     Options +ExecCGI
420     allow from all
421 </Location>
422
423 <Location /opac/extras/circ>
424     AuthType Basic
425     AuthName "Circ Extras Login"
426     PerlOptions +GlobalRequest
427     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
428     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
429     require valid-user
430     Options +ExecCGI
431     PerlSendHeader On
432     allow from all
433 </Location>
434
435 # ----------------------------------------------------------------------------------
436 # Reporting output lives here
437 # ----------------------------------------------------------------------------------
438 <Location /reporter/>
439     AuthType Basic
440     AuthName "Report Login"
441     PerlOptions +GlobalRequest
442     PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
443     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
444     require valid-user
445     Options +ExecCGI
446     PerlSendHeader On
447     allow from all
448 </Location>
449
450 # ----------------------------------------------------------------------------------
451 # Selfcheck interface
452 # ----------------------------------------------------------------------------------
453 <LocationMatch .*/selfcheck.xml>
454     AuthType Basic
455     AuthName "Self-check Login"
456     PerlOptions +GlobalRequest
457     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
458     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
459     require valid-user
460     Options +ExecCGI
461     PerlSendHeader On
462     allow from all
463 </LocationMatch>
464
465
466 # ----------------------------------------------------------------------------------
467 # Reports GUI
468 # ----------------------------------------------------------------------------------
469 <LocationMatch /reports>
470     Options +Includes
471     AddOutputFilter INCLUDES;XMLENT .xhtml
472 </LocationMatch>
473
474 <LocationMatch /reports/fm_IDL.xml>
475     IDLChunkStripPI "yes"
476     IDLChunkEscapeScript "no"
477     IDLChunkStripComments "yes"
478     IDLChunkStripDoctype "yes"
479     IDLChunkContentType "application/xml; charset=utf-8"
480     AddOutputFilter INCLUDES;IDLCHUNK .xml
481 </LocationMatch>
482
483 # ----------------------------------------------------------------------------------
484 # EDI Message viewer
485 # ----------------------------------------------------------------------------------
486 <Location /edi>
487     SetHandler perl-script
488     PerlHandler OpenILS::WWW::EDI
489     Options +ExecCGI
490     PerlSendHeader On
491     allow from all
492 </Location>     
493
494 # ----------------------------------------------------------------------------------
495 # XML-RPC gateway
496 # ----------------------------------------------------------------------------------
497 <Location /xml-rpc>
498     SetHandler perl-script
499     PerlHandler OpenILS::WWW::XMLRPCGateway
500     Options +ExecCGI
501     PerlSendHeader On
502     allow from all
503 </Location>
504
505 # ----------------------------------------------------------------------------------
506 # Conify - next-generation Evergreen administration interface
507 # ----------------------------------------------------------------------------------
508 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
509 <Location /conify>
510     Options +Includes
511     XMLEntStripPI "yes"
512     XMLEntEscapeScript "no"
513     XMLEntStripComments "no"
514     XMLEntContentType "text/html; charset=utf-8"
515     AddOutputFilter INCLUDES;XMLENT .html
516  
517     AuthType Basic
518     AuthName "Dojo Admin Login"
519     PerlOptions +GlobalRequest
520     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
521     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
522     require valid-user
523     Options +ExecCGI
524     PerlSendHeader On
525     allow from all
526 </Location>
527
528 <Location /vandelay-upload>
529     SetHandler perl-script
530     PerlHandler OpenILS::WWW::Vandelay::spool_marc
531     Options +ExecCGI
532     allow from all
533 </Location>
534
535 # OpenURL 0.1 searching based on OpenSearch
536 RewriteMap openurl prg:/openils/bin/openurl_map.pl
537 RewriteCond %{QUERY_STRING} (^.*$)
538 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
539
540
541
542 # General Evergreen web template processor
543 <Location /eg>
544     SetHandler perl-script
545     PerlHandler OpenILS::WWW::EGWeb
546     Options +ExecCGI
547     PerlSendHeader On
548     allow from all
549
550     PerlSetVar OILSWebBasePath "/eg"
551     PerlSetVar OILSWebWebDir "/openils/var/web"
552     PerlSetVar OILSWebDefaultTemplateExtension "tt2"
553
554     # Enable Template-Toolkit error debugging messages (apache error log)
555     PerlSetVar OILSWebDebugTemplate "true"
556
557     # -------------------------------------------------------
558     # Media Prefix.  In the 3rd example, the protocol (http) is enforced
559     #PerlSetVar OILSWebMediaPrefix "/media"
560     #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
561     #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
562
563     # Locale messages files
564     #PerlAddVar OILSWebLocale "en"
565     #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en.po"
566     #PerlAddVar OILSWebLocale "en_ca"
567     #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en_ca.po"
568     #PerlAddVar OILSWebLocale "fr_ca"
569     #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.fr_ca.po"
570
571     # Templates will be loaded from the following paths in reverse order.
572     PerlAddVar OILSWebTemplatePath "/openils/var/templates"
573     #PerlAddVar OILSWebTemplatePath "/openils/var/templates_localskin"
574
575     #-------------------------------------------------
576     # Added Content Configuration
577     #-------------------------------------------------
578     # Content Cafe
579     #SetEnv OILS_CONTENT_CAFE_USER MYUSER
580     #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
581     
582     # LibraryThing
583     #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
584     #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
585     
586     # ChiliFresh
587     #SetEnv OILS_CHILIFRESH_ACCOUNT
588     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
589     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
590     #-------------------------------------------------
591
592     <IfModule mod_deflate.c>
593         SetOutputFilter DEFLATE
594         BrowserMatch ^Mozilla/4 gzip-only-text/html
595         BrowserMatch ^Mozilla/4\.0[678] no-gzip
596         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
597         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
598         <IfModule mod_headers.c>
599             Header append Cache-Control "public"
600             Header append Vary User-Agent env=!dont-vary
601         </IfModule>
602     </IfModule>
603 </Location>
604 <LocationMatch ^/(images|css|js)/>
605     # should pick up the default expire time from eg.conf...
606     <IfModule mod_deflate.c>
607         SetOutputFilter DEFLATE
608         BrowserMatch ^Mozilla/4 gzip-only-text/html
609         BrowserMatch ^Mozilla/4\.0[678] no-gzip
610         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
611         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
612         <IfModule mod_headers.c>
613             Header append Cache-Control "public"
614             Header append Vary User-Agent env=!dont-vary
615         </IfModule>
616     </IfModule>
617 </LocationMatch>
618 <Location /eg/opac>
619     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
620     # Expire the HTML quickly since we're loading dynamic data for each page
621     ExpiresActive On
622     ExpiresByType text/html "access plus 5 seconds"
623     PerlSetVar KPacConfigFile "/openils/conf/kpac.xml.example"
624 </Location>
625 <Location /eg/kpac>
626     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader"
627     ExpiresActive On
628     ExpiresByType text/html "access plus 5 seconds"
629 </Location>
630
631 # Note: the template processor will decline handling anything it does not
632 # have an explicit configuration for, which means it will fall back to 
633 # Apache to serve the file.  However, in the interest of speed, go ahead 
634 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
635 # Add more exemptions as needed.
636 <LocationMatch ^/eg/.*(\.js|\.css|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
637     SetHandler None
638 </LocationMatch>
639
640 # ----------------------------------------------------------------------------------
641 # Some mod_deflate logging setup
642 # ----------------------------------------------------------------------------------
643 <IfModule mod_deflate.c>
644     DeflateFilterNote Input instream
645     DeflateFilterNote Output outstream
646     DeflateFilterNote Ratio ratio
647
648     LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
649     CustomLog /var/log/apache2/deflate_log deflate
650
651     # There are problems with XMLENT and mod_deflate - so lets disable it
652     # This is where we don't have a pre-existing LocationMatch directive earlier
653     <LocationMatch /opac/.*\.xml$>
654         SetEnv no-gzip
655     </LocationMatch>
656     <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
657         SetEnv no-gzip
658     </LocationMatch>
659     <LocationMatch /reports/.*\.xhtml$>
660         SetEnv no-gzip
661     </LocationMatch>
662     <LocationMatch /conify/.*\.html$>
663         SetEnv no-gzip
664     </LocationMatch>
665 </IfModule>
666
667
668 <Location /IDL2js>
669
670     SetHandler perl-script
671     PerlHandler OpenILS::WWW::IDL2js
672     Options +ExecCGI
673     PerlSendHeader On
674     allow from all
675
676     <IfModule mod_headers.c>
677         Header append Cache-Control "public"
678     </IFModule>
679
680     <IfModule mod_deflate.c>
681         SetOutputFilter DEFLATE
682         BrowserMatch ^Mozilla/4 gzip-only-text/html
683         BrowserMatch ^Mozilla/4\.0[678] no-gzip
684         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
685         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
686         <IfModule mod_headers.c>
687             Header append Vary User-Agent env=!dont-vary
688         </IfModule>
689     </IfModule>
690 </Location>
691
692 # Uncomment the following to force SSL for everything. Note that this defeats caching
693 # and you will suffer a performance hit.
694 #RewriteCond %{HTTPS} off
695 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]