]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/apache/eg_vhost.conf.in
LP#1775466 Angular Apache configuration updates
[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     #SetEnv OILS_NOVELIST_PROFILE
200     #SetEnv OILS_NOVELIST_PASSWORD
201
202     # Uncomment to force SSL any time a patron is logged in.  This protects 
203     # authentication tokens.  Left commented out for backwards compat for now.
204     #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
205
206     # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js
207     #SetEnv OILS_OPAC_COMBINED_JS 1
208
209 </LocationMatch>
210
211 <Location /opac/>
212     # ----------------------------------------------------------------------------------
213     # Some mod_deflate fun
214     # ----------------------------------------------------------------------------------
215     <IfModule mod_deflate.c>
216         SetOutputFilter DEFLATE
217
218         BrowserMatch ^Mozilla/4 gzip-only-text/html
219         BrowserMatch ^Mozilla/4\.0[678] no-gzip
220         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
221
222         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
223
224         <IfModule mod_headers.c>
225             Header append Vary User-Agent env=!dont-vary
226         </IfModule>
227     </IfModule>
228
229 </Location>
230
231 <Location //opac/>
232     # ----------------------------------------------------------------------------------
233     # Some mod_deflate fun
234     # ----------------------------------------------------------------------------------
235     <IfModule mod_deflate.c>
236         SetOutputFilter DEFLATE
237
238         BrowserMatch ^Mozilla/4 gzip-only-text/html
239         BrowserMatch ^Mozilla/4\.0[678] no-gzip
240         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
241
242         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
243
244         <IfModule mod_headers.c>
245             Header append Vary User-Agent env=!dont-vary
246         </IfModule>
247     </IfModule>
248
249 </Location>
250
251 # ----------------------------------------------------------------------------------
252 # Force SSL on the OPAC's "My Account" page
253 # ----------------------------------------------------------------------------------
254 <LocationMatch .*/myopac.xml>
255     SSLRequireSSL
256 </LocationMatch>
257
258 RewriteCond %{QUERY_STRING} locale=([^&]*)
259 RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ %{ENV:REQUEST_SCHEME}://%{HTTP_HOST}/opac/%1/extras/slimpac/$1? [redirect]
260 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
261     AddOutputFilter INCLUDES;XMLENT .html
262 </LocationMatch>
263
264 # ----------------------------------------------------------------------------------
265 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
266 # ----------------------------------------------------------------------------------
267 RewriteCond %{HTTP:Accept-Language} ^([a-z]{2}-[A-Z]{2})$
268 # Default to en-US if we haven't matched a locale of the form xx-YY 
269 RewriteRule .? - [S=4]
270 RewriteRule ^/xul/      -       [E=locale:en-US]
271 RewriteRule ^/reports/  -       [E=locale:en-US]
272 RewriteRule .? - [E=locale:en-US]
273 RewriteRule .? - [S=3]
274 # Otherwise, set our real locale
275 RewriteRule ^/xul/      -       [E=locale:%{HTTP:Accept-Language}]
276 RewriteRule ^/reports/  -       [E=locale:%{HTTP:Accept-Language}]
277 RewriteRule .? - [E=locale:%{HTTP:Accept-Language}]
278
279 <LocationMatch /xul/.*\.x?html$>
280     Options +Includes
281     XMLEntEscapeScript "no"
282     XMLEntStripComments "yes"
283     XMLEntStripPI "yes"
284     XMLEntStripDoctype "yes"
285     XMLEntContentType "text/html; charset=utf-8"
286     AddOutputFilter INCLUDES;XMLENT .xhtml
287     AddOutputFilter INCLUDES;XMLENT .html
288     SetEnv no-gzip
289     allow from all
290 </LocationMatch>
291
292
293 <LocationMatch /xul/.*\.xul$>
294     Options +Includes
295     XMLEntContentType "application/vnd.mozilla.xul+xml"
296     AddOutputFilter INCLUDES;XMLENT .xul
297     SetEnv no-gzip
298     allow from all
299 </LocationMatch>
300
301 # ----------------------------------------------------------------------------------
302 # Supercat feeds
303 # ----------------------------------------------------------------------------------
304 <Location /opac/extras/oisbn>
305     SetHandler perl-script
306     PerlHandler OpenILS::WWW::SuperCat::oisbn
307     Options +ExecCGI
308     PerlSendHeader On
309     allow from all
310 </Location>
311 <Location /opac/extras/supercat>
312     SetHandler perl-script
313     PerlHandler OpenILS::WWW::SuperCat::supercat
314     Options +ExecCGI
315     PerlSendHeader On
316     allow from all
317 </Location>
318 <Location /opac/extras/unapi>
319     SetHandler perl-script
320     PerlHandler OpenILS::WWW::SuperCat::unapi
321     Options +ExecCGI
322     PerlSendHeader On
323     allow from all
324 </Location>
325 <Location /opac/extras/feed/bookbag>
326     SetHandler perl-script
327     PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
328     Options +ExecCGI
329     PerlSendHeader On
330     allow from all
331 </Location>
332 <Location /opac/extras/opensearch>
333     SetHandler perl-script
334     PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
335     Options +ExecCGI
336     PerlSendHeader On
337     allow from all
338 </Location>
339 <Location /opac/extras/sru>
340     SetHandler perl-script
341     PerlHandler OpenILS::WWW::SuperCat::sru_search
342     Options +ExecCGI
343     PerlSendHeader On
344     allow from all
345 </Location>
346 <Location /opac/extras/sru_auth>
347     SetHandler perl-script
348     PerlHandler OpenILS::WWW::SuperCat::sru_auth_search
349     Options +ExecCGI
350     PerlSendHeader On
351     allow from all
352 </Location>
353 <Location /opac/extras/feed/freshmeat>
354     SetHandler perl-script
355     PerlHandler OpenILS::WWW::SuperCat::changes_feed
356     Options +ExecCGI
357     PerlSendHeader On
358     allow from all
359 </Location>
360 <Location /opac/extras/browse>
361     SetHandler perl-script
362     PerlHandler OpenILS::WWW::SuperCat::string_browse
363     Options +ExecCGI
364     PerlSendHeader On
365     allow from all
366 </Location>     
367 <Location /opac/extras/startwith>
368     SetHandler perl-script
369     PerlHandler OpenILS::WWW::SuperCat::string_startwith
370     Options +ExecCGI
371     PerlSendHeader On
372     allow from all
373 </Location>     
374         
375 # ----------------------------------------------------------------------------------
376 # Module for displaying OpenSRF API documentation
377 # ----------------------------------------------------------------------------------
378 <Location /opac/extras/docgen.xsl>
379     AddOutputFilter INCLUDES .xsl
380 </Location>
381
382 # ----------------------------------------------------------------------------------
383 # Module for processing staff-client offline scripts lives here
384 # ----------------------------------------------------------------------------------
385 <Directory "@localstatedir@/cgi-bin/offline">
386     AddHandler cgi-script .pl
387     AllowOverride None
388     Options +ExecCGI
389     allow from all
390 </Directory>
391         
392         
393 # ----------------------------------------------------------------------------------
394 # XXX Note, it's important to explicitly set the JSON encoding style 
395 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change 
396 # with OpenSRF 1.0
397 # ----------------------------------------------------------------------------------
398 # OpenSRF JSON legacy gateway
399 # ----------------------------------------------------------------------------------
400 <Location /gateway>
401     SetHandler osrf_json_gateway_module
402     OSRFGatewayLegacyJSON "true"
403     allow from all
404 </Location>
405 # ----------------------------------------------------------------------------------
406 # New-style OpenSRF JSON gateway
407 # ----------------------------------------------------------------------------------
408 <Location /osrf-gateway-v1>
409     SetHandler osrf_json_gateway_module
410     OSRFGatewayLegacyJSON "false"
411     allow from all
412 </Location>
413
414 # ----------------------------------------------------------------------------------
415 # OpenSRF-over-HTTP translator
416 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
417 # ----------------------------------------------------------------------------------
418 <Location /osrf-http-translator>
419     SetHandler osrf_http_translator_module
420     allow from all
421 </Location>
422
423 # ----------------------------------------------------------------------------------
424 # The exporter lives here
425 # ----------------------------------------------------------------------------------
426 <Location /exporter>
427     SetHandler perl-script
428     AuthType Basic
429     AuthName "Exporter Login"
430     PerlOptions +GlobalRequest
431     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
432     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
433     require valid-user
434     PerlHandler OpenILS::WWW::Exporter
435     Options +ExecCGI
436     PerlSendHeader On
437     allow from all
438 </Location>
439
440 <Location /opac/extras/merge_template>
441     SetHandler perl-script
442     AuthType Basic
443     AuthName "Batch Update Login"
444     PerlOptions +GlobalRequest
445     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
446     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
447     require valid-user
448     PerlHandler OpenILS::WWW::TemplateBatchBibUpdate
449     PerlSendHeader On
450     Options +ExecCGI
451     allow from all
452 </Location>
453
454 <Location /opac/extras/circ>
455     AuthType Basic
456     AuthName "Circ Extras Login"
457     PerlOptions +GlobalRequest
458     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
459     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
460     require valid-user
461     Options +ExecCGI
462     PerlSendHeader On
463     allow from all
464 </Location>
465
466 <Location /collections>
467     SetHandler perl-script
468     AuthType Basic
469     AuthName "Collections Login"
470     PerlOptions +GlobalRequest
471     PerlSetVar OILSProxyPermissions "money.collections_tracker.create"
472     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
473     require valid-user
474     Options +ExecCGI
475     PerlSendHeader On
476     allow from all
477 </Location>
478
479 # ----------------------------------------------------------------------------------
480 # Protect Standalone/Offline mode files from public view
481 # ----------------------------------------------------------------------------------
482 <Location /standalone/>
483     AuthType Basic
484     AuthName "Standalone Mode Login"
485     PerlOptions +GlobalRequest
486     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
487     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
488     require valid-user
489     PerlSendHeader On
490     allow from all
491     SSLRequireSSL
492 </Location>
493
494 # ----------------------------------------------------------------------------------
495 # Reporting output lives here
496 # ----------------------------------------------------------------------------------
497 <Location /reporter/>
498     AuthType Basic
499     AuthName "Report Login"
500     PerlOptions +GlobalRequest
501     PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
502     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
503     require valid-user
504     Options +ExecCGI
505     PerlSendHeader On
506     allow from all
507 </Location>
508
509 # ----------------------------------------------------------------------------------
510 # Reports GUI
511 # ----------------------------------------------------------------------------------
512 <LocationMatch /reports.*\.x?html>
513     Options +Includes
514     XMLEntContentType "text/html; charset=utf-8"
515     AddOutputFilter INCLUDES;XMLENT .xhtml
516     AddOutputFilter INCLUDES;XMLENT .html
517 </LocationMatch>
518
519 <LocationMatch /reports>
520     Options +Includes
521     AddOutputFilter INCLUDES;XMLENT .xhtml
522 </LocationMatch>
523
524 # capture locale CGI param for /reports/fm_IDL.xml
525 RewriteCond %{REQUEST_URI} ^/reports/fm_IDL.xml
526 RewriteCond %{QUERY_STRING} locale=([^&;]*)
527 RewriteRule . - [E=locale:%1]
528
529 <LocationMatch /reports/fm_IDL.xml>
530     IDLChunkStripPI "yes"
531     IDLChunkEscapeScript "no"
532     IDLChunkStripComments "yes"
533     IDLChunkStripDoctype "yes"
534     IDLChunkContentType "application/xml; charset=utf-8"
535     AddOutputFilter INCLUDES;IDLCHUNK .xml
536     SetEnv no-gzip
537 </LocationMatch>
538
539 # ----------------------------------------------------------------------------------
540 # EDI Message viewer
541 # ----------------------------------------------------------------------------------
542 <Location /edi>
543     SetHandler perl-script
544     PerlHandler OpenILS::WWW::EDI
545     Options +ExecCGI
546     PerlSendHeader On
547     allow from all
548 </Location>     
549
550 # ----------------------------------------------------------------------------------
551 # XML-RPC gateway
552 # ----------------------------------------------------------------------------------
553 <Location /xml-rpc>
554     SetHandler perl-script
555     PerlHandler OpenILS::WWW::XMLRPCGateway
556     Options +ExecCGI
557     PerlSendHeader On
558     allow from all
559     <IfModule mod_headers.c>
560         Header onsuccess set Cache-Control no-cache
561     </IfModule>
562 </Location>
563
564 # ----------------------------------------------------------------------------------
565 # Conify - next-generation Evergreen administration interface
566 # ----------------------------------------------------------------------------------
567 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
568 <Location /conify>
569     Options +Includes
570     XMLEntStripPI "yes"
571     XMLEntEscapeScript "no"
572     XMLEntStripComments "no"
573     XMLEntContentType "text/html; charset=utf-8"
574     AddOutputFilter INCLUDES;XMLENT .html
575  
576     AuthType Basic
577     AuthName "Dojo Admin Login"
578     PerlOptions +GlobalRequest
579     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
580     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
581     require valid-user
582     Options +ExecCGI
583     PerlSendHeader On
584     allow from all
585 </Location>
586
587 # ----------------------------------------------------------------------------------
588 # The PhoneList lives here
589 # ----------------------------------------------------------------------------------
590 <Location /phonelist>
591     SetHandler perl-script
592     AuthType Basic
593     AuthName "PhoneList Login"
594     require valid-user
595     PerlOptions +GlobalRequest
596     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
597     PerlHandler OpenILS::WWW::PhoneList
598     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
599     Options +ExecCGI
600     PerlSendHeader On
601     allow from all
602     <IfModule mod_headers.c>
603         Header onsuccess set Cache-Control no-cache
604     </IfModule>
605 </Location>
606 <Location /vandelay-upload>
607     SetHandler perl-script
608     PerlHandler OpenILS::WWW::Vandelay::spool_marc
609     Options +ExecCGI
610     allow from all
611 </Location>
612
613 # OpenURL 0.1 searching based on OpenSearch
614 RewriteMap openurl prg:@bindir@/openurl_map.pl
615 RewriteCond %{QUERY_STRING} (^.*$)
616 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
617
618
619
620 # General Evergreen web template processor
621 <Location /eg>
622     SetHandler perl-script
623     PerlHandler OpenILS::WWW::EGWeb
624     Options +ExecCGI
625     PerlSendHeader On
626     allow from all
627
628     PerlSetVar OILSWebBasePath "/eg"
629     PerlSetVar OILSWebWebDir "@localstatedir@/web"
630     PerlSetVar OILSWebDefaultTemplateExtension "tt2"
631
632     # Port Apache listens on for HTTP traffic.  Used for HTTP requests 
633     # routed from Perl handlers back to the same Apache instance, like
634     # added content requests.  Use this when running Apache with a 
635     # non-standard port, typical with a proxy setup.  Defaults to "80".
636     # PerlSetVar OILSWebInternalHTTPPort "7080"
637
638     # Enable Template-Toolkit error debugging messages (apache error log)
639     PerlSetVar OILSWebDebugTemplate "false"
640     # local cache of compiled Template Toolkit templates
641     PerlSetVar OILSWebCompiledTemplateCache "/tmp/eg_template_cache"
642     # template TTL - how long, in seconds, that Template Toolkit
643     # waits to check for updated template files
644     #PerlSetVar OILSWebTemplateStatTTL 60
645
646     # -------------------------------------------------------
647     # Media Prefix.  In the 3rd example, the protocol (http) is enforced
648     #PerlSetVar OILSWebMediaPrefix "/media"
649     #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
650     #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
651
652     # Locale messages files:
653     #
654     # These appear in pairs; the first represents the user agent
655     # Accept-Language header locale, and the second represents
656     # the fully-qualified path for the corresponding PO file that
657     # contains the messages.
658     #
659     # If you enable two or more locales, then users will be able to
660     # select their preferred locale from a locale picker in the TPAC.
661     #
662     #PerlAddVar OILSWebLocale "en"
663     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/opac/messages.en.po"
664     #PerlAddVar OILSWebLocale "en_ca"
665     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/opac/en-CA.po"
666     #PerlAddVar OILSWebLocale "fr_ca"
667     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/opac/fr-CA.po"
668
669     # Set the default locale: defaults to en-US
670     #PerlAddVar OILSWebDefaultLocale "fr_ca"
671     
672     # Templates will be loaded from the following paths in reverse order.
673     PerlAddVar OILSWebTemplatePath "@localstatedir@/templates"
674     #PerlAddVar OILSWebTemplatePath "@localstatedir@/templates_localskin"
675
676     #-------------------------------------------------
677     # Added Content Configuration
678     #-------------------------------------------------
679     # Content Cafe
680     #SetEnv OILS_CONTENT_CAFE_USER MYUSER
681     #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
682     
683     # LibraryThing
684     #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
685     #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
686     
687     # ChiliFresh
688     #SetEnv OILS_CHILIFRESH_ACCOUNT
689     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
690     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
691     #-------------------------------------------------
692
693     <IfModule mod_deflate.c>
694         SetOutputFilter DEFLATE
695         BrowserMatch ^Mozilla/4 gzip-only-text/html
696         BrowserMatch ^Mozilla/4\.0[678] no-gzip
697         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
698         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
699         <IfModule mod_headers.c>
700             Header append Cache-Control "public"
701             Header append Vary User-Agent env=!dont-vary
702         </IfModule>
703     </IfModule>
704 </Location>
705 <LocationMatch ^/(images|css|js)/>
706     # should pick up the default expire time from eg.conf...
707     <IfModule mod_deflate.c>
708         SetOutputFilter DEFLATE
709         BrowserMatch ^Mozilla/4 gzip-only-text/html
710         BrowserMatch ^Mozilla/4\.0[678] no-gzip
711         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
712         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
713         <IfModule mod_headers.c>
714             Header append Cache-Control "public"
715             Header append Vary User-Agent env=!dont-vary
716         </IfModule>
717     </IfModule>
718 </LocationMatch>
719 <Location /eg/opac>
720     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
721     # Expire the HTML quickly since we're loading dynamic data for each page
722     ExpiresActive On
723     ExpiresByType text/html "access plus 5 seconds"
724 </Location>
725 <Location /eg/kpac>
726     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader"
727     PerlSetVar KPacConfigFile "@sysconfdir@/kpac.xml.example"
728     ExpiresActive On
729     ExpiresByType text/html "access plus 5 seconds"
730 </Location>
731
732 # Note: the template processor will decline handling anything it does not
733 # have an explicit configuration for, which means it will fall back to 
734 # Apache to serve the file.  However, in the interest of speed, go ahead 
735 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
736 # Add more exemptions as needed.
737 <LocationMatch ^/eg/.*(\.js|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
738     SetHandler None
739 </LocationMatch>
740
741 # ----------------------------------------------------------------------------------
742 # Some mod_deflate setup
743 # ----------------------------------------------------------------------------------
744 <IfModule mod_deflate.c>
745     ## optional logging for mod_deflate debugging
746     ##DeflateFilterNote Input instream
747     ##DeflateFilterNote Output outstream
748     ##DeflateFilterNote Ratio ratio
749     ##
750     ##LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
751     ##CustomLog /var/log/apache2/deflate_log deflate
752
753     # There are problems with XMLENT and mod_deflate - so lets disable it
754     # This is where we don't have a pre-existing LocationMatch directive earlier
755     <LocationMatch /opac/.*\.xml$>
756         SetEnv no-gzip
757     </LocationMatch>
758     <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
759         SetEnv no-gzip
760     </LocationMatch>
761     <LocationMatch /reports/.*\.xhtml$>
762         SetEnv no-gzip
763     </LocationMatch>
764     <LocationMatch /conify/.*\.html$>
765         SetEnv no-gzip
766     </LocationMatch>
767 </IfModule>
768
769
770 <Location /IDL2js>
771
772     SetHandler perl-script
773     PerlHandler OpenILS::WWW::IDL2js
774     Options +ExecCGI
775     PerlSendHeader On
776     allow from all
777
778     <IfModule mod_headers.c>
779         Header append Cache-Control "public"
780     </IFModule>
781
782     <IfModule mod_deflate.c>
783         SetOutputFilter DEFLATE
784         BrowserMatch ^Mozilla/4 gzip-only-text/html
785         BrowserMatch ^Mozilla/4\.0[678] no-gzip
786         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
787         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
788         <IfModule mod_headers.c>
789             Header append Vary User-Agent env=!dont-vary
790         </IfModule>
791     </IfModule>
792 </Location>
793
794 <LocationMatch /eg/staff/>
795     SSLRequireSSL
796     Options -MultiViews
797     PerlSetVar OILSWebStopAtIndex "true"
798
799     RewriteCond %{HTTPS} off
800     RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]
801
802     # sample staff-specific translation files
803     #PerlAddVar OILSWebLocale "en_ca"
804     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/staff/en-CA.po"
805     #PerlAddVar OILSWebLocale "fr_ca"
806     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/staff/fr-CA.po"
807 </LocationMatch>
808
809 <Location /js/>
810     <IfModule mod_headers.c>
811         Header append Cache-Control "public"
812     </IFModule>
813     <IfModule mod_deflate.c>
814         SetOutputFilter DEFLATE
815         BrowserMatch ^Mozilla/4 gzip-only-text/html
816         BrowserMatch ^Mozilla/4\.0[678] no-gzip
817         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
818         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
819         <IfModule mod_headers.c>
820             Header append Vary User-Agent env=!dont-vary
821         </IfModule>
822     </IfModule>
823 </Location>
824
825 # Uncomment the following to force SSL for everything. Note that this defeats caching
826 # and you will suffer a performance hit.
827 #RewriteCond %{HTTPS} off
828 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]
829
830
831 # ------------------------------------------------------------------------
832 # /eg2/ client setup and locale configuration.
833 #
834 # If a valid locale cookie is present that does not match the current
835 # path, redirect to the requested locale path.
836 # Otherwise, if no locale is active, redirect to the default locale.
837
838 # fr-CA
839 #RewriteCond %{REQUEST_URI} ^/eg2/
840 #RewriteCond %{REQUEST_URI} !^/eg2/fr-CA/
841 #RewriteCond %{HTTP_COOKIE} eg_locale=fr_ca
842 #RewriteRule ^/eg2/(.*) https://%{HTTP_HOST}/eg2/fr-CA/$1 [R=307,L]
843
844 # Default / en-US.
845 # No alternate supported cookie provided.
846 RewriteCond %{REQUEST_URI}  ^/eg2/
847 RewriteCond %{REQUEST_URI}  !^/eg2/([a-z]{2}-[A-Z]{2})/
848 RewriteRule ^/eg2/(.*) https://%{HTTP_HOST}/eg2/en-US/$1 [R=307,L]
849
850 # en-US build
851 # This is the only required configuration when only using the default locale.
852 <Directory "/openils/var/web/eg2/en-US">
853     FallbackResource /eg2/en-US/index.html
854 </Directory>
855
856 # fr-CA build
857 #<Directory "/openils/var/web/eg2/fr-CA">
858 #    FallbackResource /eg2/fr-CA/index.html
859 #</Directory>