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