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