]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/examples/apache/eg_vhost.conf
0265d6666a18b3f7adc64ddf25560507d573d569
[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 <Location /collections>
436     SetHandler perl-script
437     AuthType Basic
438     AuthName "Collections Login"
439     PerlOptions +GlobalRequest
440     PerlSetVar OILSProxyPermissions "money.collections_tracker.create"
441     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
442     require valid-user
443     Options +ExecCGI
444     PerlSendHeader On
445     allow from all
446 </Location>
447
448
449 # ----------------------------------------------------------------------------------
450 # Reporting output lives here
451 # ----------------------------------------------------------------------------------
452 <Location /reporter/>
453     AuthType Basic
454     AuthName "Report Login"
455     PerlOptions +GlobalRequest
456     PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
457     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
458     require valid-user
459     Options +ExecCGI
460     PerlSendHeader On
461     allow from all
462 </Location>
463
464 # ----------------------------------------------------------------------------------
465 # Selfcheck interface
466 # ----------------------------------------------------------------------------------
467 <LocationMatch .*/selfcheck.xml>
468     AuthType Basic
469     AuthName "Self-check Login"
470     PerlOptions +GlobalRequest
471     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
472     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
473     require valid-user
474     Options +ExecCGI
475     PerlSendHeader On
476     allow from all
477 </LocationMatch>
478
479
480 # ----------------------------------------------------------------------------------
481 # Reports GUI
482 # ----------------------------------------------------------------------------------
483 <LocationMatch /reports>
484     Options +Includes
485     AddOutputFilter INCLUDES;XMLENT .xhtml
486 </LocationMatch>
487
488 <LocationMatch /reports/fm_IDL.xml>
489     IDLChunkStripPI "yes"
490     IDLChunkEscapeScript "no"
491     IDLChunkStripComments "yes"
492     IDLChunkStripDoctype "yes"
493     IDLChunkContentType "application/xml; charset=utf-8"
494     AddOutputFilter INCLUDES;IDLCHUNK .xml
495 </LocationMatch>
496
497 # ----------------------------------------------------------------------------------
498 # EDI Message viewer
499 # ----------------------------------------------------------------------------------
500 <Location /edi>
501     SetHandler perl-script
502     PerlHandler OpenILS::WWW::EDI
503     Options +ExecCGI
504     PerlSendHeader On
505     allow from all
506 </Location>     
507
508 # ----------------------------------------------------------------------------------
509 # XML-RPC gateway
510 # ----------------------------------------------------------------------------------
511 <Location /xml-rpc>
512     SetHandler perl-script
513     PerlHandler OpenILS::WWW::XMLRPCGateway
514     Options +ExecCGI
515     PerlSendHeader On
516     allow from all
517 </Location>
518
519 # ----------------------------------------------------------------------------------
520 # Conify - next-generation Evergreen administration interface
521 # ----------------------------------------------------------------------------------
522 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
523 <Location /conify>
524     Options +Includes
525     XMLEntStripPI "yes"
526     XMLEntEscapeScript "no"
527     XMLEntStripComments "no"
528     XMLEntContentType "text/html; charset=utf-8"
529     AddOutputFilter INCLUDES;XMLENT .html
530  
531     AuthType Basic
532     AuthName "Dojo Admin Login"
533     PerlOptions +GlobalRequest
534     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
535     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
536     require valid-user
537     Options +ExecCGI
538     PerlSendHeader On
539     allow from all
540 </Location>
541
542 <Location /vandelay-upload>
543     SetHandler perl-script
544     PerlHandler OpenILS::WWW::Vandelay::spool_marc
545     Options +ExecCGI
546     allow from all
547 </Location>
548
549 # OpenURL 0.1 searching based on OpenSearch
550 RewriteMap openurl prg:/openils/bin/openurl_map.pl
551 RewriteCond %{QUERY_STRING} (^.*$)
552 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
553
554
555
556 # General Evergreen web template processor
557 <Location /eg>
558     SetHandler perl-script
559     PerlHandler OpenILS::WWW::EGWeb
560     Options +ExecCGI
561     PerlSendHeader On
562     allow from all
563
564     PerlSetVar OILSWebBasePath "/eg"
565     PerlSetVar OILSWebWebDir "/openils/var/web"
566     PerlSetVar OILSWebDefaultTemplateExtension "tt2"
567
568     # Enable Template-Toolkit error debugging messages (apache error log)
569     PerlSetVar OILSWebDebugTemplate "true"
570
571     # -------------------------------------------------------
572     # Media Prefix.  In the 3rd example, the protocol (http) is enforced
573     #PerlSetVar OILSWebMediaPrefix "/media"
574     #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
575     #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
576
577     # Locale messages files
578     #PerlAddVar OILSWebLocale "en"
579     #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en.po"
580     #PerlAddVar OILSWebLocale "en_ca"
581     #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.en_ca.po"
582     #PerlAddVar OILSWebLocale "fr_ca"
583     #PerlAddVar OILSWebLocale "/openils/var/data/locale/messages.fr_ca.po"
584
585     # Templates will be loaded from the following paths in reverse order.
586     PerlAddVar OILSWebTemplatePath "/openils/var/templates"
587     #PerlAddVar OILSWebTemplatePath "/openils/var/templates_localskin"
588
589     #-------------------------------------------------
590     # Added Content Configuration
591     #-------------------------------------------------
592     # Content Cafe
593     #SetEnv OILS_CONTENT_CAFE_USER MYUSER
594     #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
595     
596     # LibraryThing
597     #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
598     #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
599     
600     # ChiliFresh
601     #SetEnv OILS_CHILIFRESH_ACCOUNT
602     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
603     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
604     #-------------------------------------------------
605
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 </Location>
618 <LocationMatch ^/(images|css|js)/>
619     # should pick up the default expire time from eg.conf...
620     <IfModule mod_deflate.c>
621         SetOutputFilter DEFLATE
622         BrowserMatch ^Mozilla/4 gzip-only-text/html
623         BrowserMatch ^Mozilla/4\.0[678] no-gzip
624         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
625         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
626         <IfModule mod_headers.c>
627             Header append Cache-Control "public"
628             Header append Vary User-Agent env=!dont-vary
629         </IfModule>
630     </IfModule>
631 </LocationMatch>
632 <Location /eg/opac>
633     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
634     # Expire the HTML quickly since we're loading dynamic data for each page
635     ExpiresActive On
636     ExpiresByType text/html "access plus 5 seconds"
637 </Location>
638 <Location /eg/kpac>
639     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader"
640     PerlSetVar KPacConfigFile "/openils/conf/kpac.xml.example"
641     ExpiresActive On
642     ExpiresByType text/html "access plus 5 seconds"
643 </Location>
644
645 # Note: the template processor will decline handling anything it does not
646 # have an explicit configuration for, which means it will fall back to 
647 # Apache to serve the file.  However, in the interest of speed, go ahead 
648 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
649 # Add more exemptions as needed.
650 <LocationMatch ^/eg/.*(\.js|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
651     SetHandler None
652 </LocationMatch>
653
654 # ----------------------------------------------------------------------------------
655 # Some mod_deflate logging setup
656 # ----------------------------------------------------------------------------------
657 <IfModule mod_deflate.c>
658     DeflateFilterNote Input instream
659     DeflateFilterNote Output outstream
660     DeflateFilterNote Ratio ratio
661
662     LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
663     CustomLog /var/log/apache2/deflate_log deflate
664
665     # There are problems with XMLENT and mod_deflate - so lets disable it
666     # This is where we don't have a pre-existing LocationMatch directive earlier
667     <LocationMatch /opac/.*\.xml$>
668         SetEnv no-gzip
669     </LocationMatch>
670     <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
671         SetEnv no-gzip
672     </LocationMatch>
673     <LocationMatch /reports/.*\.xhtml$>
674         SetEnv no-gzip
675     </LocationMatch>
676     <LocationMatch /conify/.*\.html$>
677         SetEnv no-gzip
678     </LocationMatch>
679 </IfModule>
680
681
682 <Location /IDL2js>
683
684     SetHandler perl-script
685     PerlHandler OpenILS::WWW::IDL2js
686     Options +ExecCGI
687     PerlSendHeader On
688     allow from all
689
690     <IfModule mod_headers.c>
691         Header append Cache-Control "public"
692     </IFModule>
693
694     <IfModule mod_deflate.c>
695         SetOutputFilter DEFLATE
696         BrowserMatch ^Mozilla/4 gzip-only-text/html
697         BrowserMatch ^Mozilla/4\.0[678] no-gzip
698         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
699         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
700         <IfModule mod_headers.c>
701             Header append Vary User-Agent env=!dont-vary
702         </IfModule>
703     </IfModule>
704 </Location>
705
706 # Uncomment the following to force SSL for everything. Note that this defeats caching
707 # and you will suffer a performance hit.
708 #RewriteCond %{HTTPS} off
709 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]