]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/examples/apache_24/eg_vhost.conf.in
2e511169045889f29363565ade30414e591d7b06
[working/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 RedirectMatch 301 ^/$ /eg/opac/home
10
11 # ----------------------------------------------------------------------------------
12 # Point / to the IP address redirector
13 # ----------------------------------------------------------------------------------
14 #<LocationMatch ^/$>
15 #    SetHandler perl-script
16 #    PerlHandler OpenILS::WWW::Redirect
17 #    Options +ExecCGI
18 #    PerlSendHeader On
19 #    #PerlSetVar OILSRedirectSkin "default"
20 #    # OILSRedirectDepth defaults to the depth of the branch that the OPAC was directed to
21 #    #PerlSetVar OILSRedirectDepth "0"
22 #    #PerlSetVar OILSRedirectLocale "en-US"
23 #    # Use the template-toolkit opac
24 #    #PerlSetVar OILSRedirectTpac "true"
25 #    allow from all
26 #</LocationMatch>
27
28
29 # ----------------------------------------------------------------------------------
30 # Assign a default locale to the accessible OPAC
31 # ----------------------------------------------------------------------------------
32 RedirectMatch 301 ^/opac/extras/slimpac/start.html$    /opac/en-US/extras/slimpac/start.html
33 RedirectMatch 301 ^/opac/extras/slimpac/advanced.html$ /opac/en-US/extras/slimpac/advanced.html
34
35 # ----------------------------------------------------------------------------------
36 # Configure the gateway
37 # ----------------------------------------------------------------------------------
38 OSRFGatewayConfig @sysconfdir@/opensrf_core.xml
39 # Translator memcache server.  Default is localhost
40 # OSRFTranslatorCacheServer 127.0.0.1:11211
41
42
43 # ----------------------------------------------------------------------------------
44 # Added content plugin
45 # ----------------------------------------------------------------------------------
46 <Location /opac/extras/ac/>
47     SetHandler perl-script
48     PerlHandler OpenILS::WWW::AddedContent
49     Options +ExecCGI
50     PerlSendHeader On
51     Require all granted 
52 </Location>
53
54 # Autosuggest for searches
55 <Location /opac/extras/autosuggest>
56     SetHandler perl-script
57     PerlHandler OpenILS::WWW::AutoSuggest
58     PerlSendHeader On
59     Require all granted 
60 </Location>
61
62 # Flattener service
63 <Location /opac/extras/flattener>
64     SetHandler perl-script
65     PerlHandler OpenILS::WWW::FlatFielder
66     PerlSendHeader On
67     Require all granted 
68 </Location>
69
70 # ----------------------------------------------------------------------------------
71 # Replace broken cover images with a transparent GIF by default
72 # ----------------------------------------------------------------------------------
73 RewriteEngine ON
74 RewriteRule ^/opac/extras/ac/jacket/(small|medium|large)/$ \
75     /opac/images/blank.png [P,L]
76
77 # ----------------------------------------------------------------------------------
78 # Add the row ID (RID) and date so we can make unAPI happy
79 # ----------------------------------------------------------------------------------
80 RewriteCond %{QUERY_STRING} (^r|&r)=(\d+)
81 RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}]
82
83 # ----------------------------------------------------------------------------------
84 # Pull the locale from the URL
85 # ----------------------------------------------------------------------------------
86 RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
87 RewriteRule . - [E=locale:%1]
88
89 # ----------------------------------------------------------------------------------
90 # Rewrite JSPac->TPac with redirects
91 # ----------------------------------------------------------------------------------
92
93 # First things first, extract useful data
94 # And we are going to start with a "this is the JSPac" check on each of these:
95 # RewriteCond %{REQUEST_URI} ^/?opac/
96
97 # Basic (overall) search type, if present
98 # I am cheating and grabbing RT or TP because I dunno the difference between them.
99 RewriteCond %{REQUEST_URI} ^/opac/
100 RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])(rt|tp)=([^;&]*)
101 RewriteRule . - [E=OILS_JSPAC_SEARCH_TYPE:qtype=%3;]
102
103 # Basic (overall) search term(s), if present - NOTE: Not doing advanced search.
104 RewriteCond %{REQUEST_URI} ^/opac/
105 RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])t=([^;&]*)
106 RewriteRule . - [E=OILS_JSPAC_SEARCH_TERMS:query=%2;]
107
108 # Search Location, if present
109 RewriteCond %{REQUEST_URI} ^/opac/
110 RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])l=([^;&]*)
111 RewriteRule . - [E=OILS_JSPAC_SEARCH_LOCATION:locg=%2;]
112
113 # My Account
114 RewriteRule /opac/[^/]*/skin/default/xml/myopac.xml /eg/opac/myopac/main?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
115
116 # Record Pages
117 # /opac/en-US/skin/default/xml/rdetail.xml?r=32 -> /eg/opac/record/32
118 RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])r=([^;&]*)
119 RewriteRule /opac/.*/rdetail.xml /eg/opac/record/%2?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
120
121 # Bookbag Pages
122 # /opac/extras/feed/bookbag/html-full/1 -> /eg/opac/results?bookbag=1;page=0;locg=1;depth=0
123 RewriteRule /opac/extras/feed/bookbag/html-full/(\d*) /eg/opac/results?bookbag=$1;%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
124
125 # Search Results Pages
126 RewriteRule /opac/[^/]*/skin/[^/]*/xml/rresult.xml /eg/opac/results?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
127
128 # Basic Search (STILL not doing advanced)
129 # Fallback! But only for things that end in xml, htm, or html
130 # Images, CSS, etc can stick around.
131 RewriteRule /opac/[^/]*/skin/.*(xml|htm|html|/)$ /eg/opac/home?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L]
132
133 # ----------------------------------------------------------------------------------
134 # For sanity reasons, default indexes to Off
135 # ----------------------------------------------------------------------------------
136 Options -Indexes
137
138 # ----------------------------------------------------------------------------------
139 # Configure the OPAC
140 # ----------------------------------------------------------------------------------
141 <LocationMatch /opac/>
142     SSILegacyExprParser on
143     AddType application/xhtml+xml .xml
144    
145     # - configure mod_xmlent
146     XMLEntStripPI "yes"
147     XMLEntEscapeScript "no"
148     XMLEntStripComments "yes"
149     XMLEntContentType "text/html; charset=utf-8"
150     # forces quirks mode which we want for now
151     XMLEntStripDoctype "yes" 
152
153     # - set up the include handlers
154     Options +Includes
155     AddOutputFilter INCLUDES .xsl
156     AddOutputFilter INCLUDES;XMLENT .xml
157                     
158     SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
159     
160     # This gives you the option to configure a different host to serve OPAC images from
161     # Specify the hostname (without protocol) and path to the images.  Protocol will
162     # be determined at runtime
163     #SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=static.example.org/opac/
164
165     # In addition to loading images from a static host, you can also load CSS and/or
166     # Javascript from a static host or hosts. Protocol will be determined at runtime
167     # and/or by configuration options immediately following.
168     #SetEnvIf Request_URI ".*" OILS_OPAC_CSS_HOST=static.example.org/opac/
169     #SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=static.example.org/opac/
170
171     # If you are not able to serve static content via https and 
172     # wish to force http:// (and are comfortable with mixed-content
173     # warnings in client browsers), set this:
174     #SetEnvIf Request_URI ".*" OILS_OPAC_STATIC_PROTOCOL=http
175
176     # If you would prefer to fall back to your non-static servers for 
177     # https pages, avoiding mixed-content warnings in client browsers
178     # and are willing to accept some increased server load, set this:
179     #SetEnvIf Request_URI ".*" OILS_OPAC_BYPASS_STATIC_FOR_HTTPS=yes
180
181     # Specify a ChiliFresh account to integrate their services with the OPAC
182     #SetEnv OILS_CHILIFRESH_ACCOUNT
183     #SetEnv OILS_CHILIFRESH_PROFILE
184     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
185     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
186
187     # Specify the initial script URL for Novelist (containing account credentials, etc.)
188     #SetEnv OILS_NOVELIST_URL
189     #
190
191     # Uncomment to force SSL any time a patron is logged in.  This protects 
192     # authentication tokens.  Left commented out for backwards compat for now.
193     #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
194
195     # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js
196     #SetEnv OILS_OPAC_COMBINED_JS 1
197
198 </LocationMatch>
199
200 <Location /opac/>
201     # ----------------------------------------------------------------------------------
202     # Some mod_deflate fun
203     # ----------------------------------------------------------------------------------
204     <IfModule mod_deflate.c>
205         SetOutputFilter DEFLATE
206
207         BrowserMatch ^Mozilla/4 gzip-only-text/html
208         BrowserMatch ^Mozilla/4\.0[678] no-gzip
209         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
210
211         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
212
213         <IfModule mod_headers.c>
214             Header append Vary User-Agent env=!dont-vary
215         </IfModule>
216     </IfModule>
217
218 </Location>
219
220 <Location //opac/>
221     # ----------------------------------------------------------------------------------
222     # Some mod_deflate fun
223     # ----------------------------------------------------------------------------------
224     <IfModule mod_deflate.c>
225         SetOutputFilter DEFLATE
226
227         BrowserMatch ^Mozilla/4 gzip-only-text/html
228         BrowserMatch ^Mozilla/4\.0[678] no-gzip
229         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
230
231         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
232
233         <IfModule mod_headers.c>
234             Header append Vary User-Agent env=!dont-vary
235         </IfModule>
236     </IfModule>
237
238 </Location>
239
240 # ----------------------------------------------------------------------------------
241 # Force SSL on the OPAC's "My Account" page
242 # ----------------------------------------------------------------------------------
243 <LocationMatch .*/myopac.xml>
244     SSLRequireSSL
245 </LocationMatch>
246
247 <LocationMatch /opac/extras/>
248     SSILegacyExprParser on
249     # Force to en-US for now to satisfy bbags.xml
250     SetEnv locale en-US
251     Options +Includes
252     AddOutputFilter INCLUDES .xml
253     AddType application/xhtml+xml .xml
254 </LocationMatch>
255
256 RewriteCond %{QUERY_STRING} locale=([^&]*)
257 RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
258 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
259     AddOutputFilter INCLUDES;XMLENT .html
260 </LocationMatch>
261
262 # ----------------------------------------------------------------------------------
263 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
264 # ----------------------------------------------------------------------------------
265 RewriteCond %{HTTP:Accept-Language} ^([a-z]{2}-[A-Z]{2})$
266 # Default to en-US if we haven't matched a locale of the form xx-YY 
267 RewriteRule .? - [S=4]
268 RewriteRule ^/xul/      -       [E=locale:en-US]
269 RewriteRule ^/reports/  -       [E=locale:en-US]
270 RewriteRule .? - [E=locale:en-US]
271 RewriteRule .? - [S=3]
272 # Otherwise, set our real locale
273 RewriteRule ^/xul/      -       [E=locale:%{HTTP:Accept-Language}]
274 RewriteRule ^/reports/  -       [E=locale:%{HTTP:Accept-Language}]
275 RewriteRule .? - [E=locale:%{HTTP:Accept-Language}]
276
277 <LocationMatch /xul/.*\.x?html$>
278     SSILegacyExprParser on
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     Require all granted 
289 </LocationMatch>
290
291
292 <LocationMatch /xul/.*\.xul$>
293     SSILegacyExprParser on
294     Options +Includes
295     XMLEntContentType "application/vnd.mozilla.xul+xml"
296     AddOutputFilter INCLUDES;XMLENT .xul
297     SetEnv no-gzip
298     Require all granted 
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     Require all granted 
310 </Location>
311 <Location /opac/extras/supercat>
312     SetHandler perl-script
313     PerlHandler OpenILS::WWW::SuperCat::supercat
314     Options +ExecCGI
315     PerlSendHeader On
316     Require all granted 
317 </Location>
318 <Location /opac/extras/unapi>
319     SetHandler perl-script
320     PerlHandler OpenILS::WWW::SuperCat::unapi
321     Options +ExecCGI
322     PerlSendHeader On
323     Require all granted 
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     Require all granted 
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     Require all granted 
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     Require all granted 
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     Require all granted 
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     Require all granted 
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     Require all granted 
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     Require all granted 
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     Require all granted 
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     Require all granted 
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     Require all granted 
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     Require all granted 
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     Require all granted 
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     Require all granted 
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     Require all granted 
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     Require all granted 
477 </Location>
478
479
480 # ----------------------------------------------------------------------------------
481 # Reporting output lives here
482 # ----------------------------------------------------------------------------------
483 <Location /reporter/>
484     AuthType Basic
485     AuthName "Report Login"
486     PerlOptions +GlobalRequest
487     PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
488     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
489     require valid-user
490     Options +ExecCGI
491     PerlSendHeader On
492     Require all granted 
493 </Location>
494
495 # ----------------------------------------------------------------------------------
496 # Selfcheck interface
497 # ----------------------------------------------------------------------------------
498 <LocationMatch .*/selfcheck.xml>
499     AuthType Basic
500     AuthName "Self-check Login"
501     PerlOptions +GlobalRequest
502     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
503     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
504     require valid-user
505     Options +ExecCGI
506     PerlSendHeader On
507     Require all granted 
508 </LocationMatch>
509
510
511 # ----------------------------------------------------------------------------------
512 # Reports GUI
513 # ----------------------------------------------------------------------------------
514 <LocationMatch /reports>
515     SSILegacyExprParser on
516     Options +Includes
517     AddOutputFilter INCLUDES;XMLENT .xhtml
518 </LocationMatch>
519
520 # capture locale CGI param for /reports/fm_IDL.xml
521 RewriteCond %{REQUEST_URI} ^/reports/fm_IDL.xml
522 RewriteCond %{QUERY_STRING} locale=([^&;]*)
523 RewriteRule . - [E=locale:%1]
524
525 <LocationMatch /reports/fm_IDL.xml>
526     IDLChunkStripPI "yes"
527     IDLChunkEscapeScript "no"
528     IDLChunkStripComments "yes"
529     IDLChunkStripDoctype "yes"
530     IDLChunkContentType "application/xml; charset=utf-8"
531     AddOutputFilter INCLUDES;IDLCHUNK .xml
532 </LocationMatch>
533
534 # ----------------------------------------------------------------------------------
535 # EDI Message viewer
536 # ----------------------------------------------------------------------------------
537 <Location /edi>
538     SetHandler perl-script
539     PerlHandler OpenILS::WWW::EDI
540     Options +ExecCGI
541     PerlSendHeader On
542     Require all granted 
543 </Location>     
544
545 # ----------------------------------------------------------------------------------
546 # XML-RPC gateway
547 # ----------------------------------------------------------------------------------
548 <Location /xml-rpc>
549     SetHandler perl-script
550     PerlHandler OpenILS::WWW::XMLRPCGateway
551     Options +ExecCGI
552     PerlSendHeader On
553     Require all granted 
554     <IfModule mod_headers.c>
555         Header onsuccess set Cache-Control no-cache
556     </IfModule>
557 </Location>
558
559 # ----------------------------------------------------------------------------------
560 # Conify - next-generation Evergreen administration interface
561 # ----------------------------------------------------------------------------------
562 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
563 <Location /conify>
564     SSILegacyExprParser on
565     Options +Includes
566     XMLEntStripPI "yes"
567     XMLEntEscapeScript "no"
568     XMLEntStripComments "no"
569     XMLEntContentType "text/html; charset=utf-8"
570     AddOutputFilter INCLUDES;XMLENT .html
571  
572     AuthType Basic
573     AuthName "Dojo Admin Login"
574     PerlOptions +GlobalRequest
575     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
576     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
577     require valid-user
578     Options +ExecCGI
579     PerlSendHeader On
580     Require all granted 
581 </Location>
582
583 # ----------------------------------------------------------------------------------
584 # The PhoneList lives here
585 # ----------------------------------------------------------------------------------
586 <Location /phonelist>
587     SetHandler perl-script
588     AuthType Basic
589     AuthName "PhoneList Login"
590     require valid-user
591     PerlOptions +GlobalRequest
592     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
593     PerlHandler OpenILS::WWW::PhoneList
594     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
595     Options +ExecCGI
596     PerlSendHeader On
597     allow from all
598     <IfModule mod_headers.c>
599         Header onsuccess set Cache-Control no-cache
600     </IfModule>
601 </Location>
602 <Location /vandelay-upload>
603     SetHandler perl-script
604     PerlHandler OpenILS::WWW::Vandelay::spool_marc
605     Options +ExecCGI
606     Require all granted 
607 </Location>
608
609 # OpenURL 0.1 searching based on OpenSearch
610 RewriteMap openurl prg:@bindir@/openurl_map.pl
611 RewriteCond %{QUERY_STRING} (^.*$)
612 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
613
614
615
616 # General Evergreen web template processor
617 <Location /eg>
618     SetHandler perl-script
619     PerlHandler OpenILS::WWW::EGWeb
620     Options +ExecCGI
621     PerlSendHeader On
622     Require all granted 
623
624     PerlSetVar OILSWebBasePath "/eg"
625     PerlSetVar OILSWebWebDir "@localstatedir@/web"
626     PerlSetVar OILSWebDefaultTemplateExtension "tt2"
627
628     # Enable Template-Toolkit error debugging messages (apache error log)
629     PerlSetVar OILSWebDebugTemplate "true"
630
631     # -------------------------------------------------------
632     # Media Prefix.  In the 3rd example, the protocol (http) is enforced
633     #PerlSetVar OILSWebMediaPrefix "/media"
634     #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
635     #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
636
637     # Locale messages files:
638     #
639     # These appear in pairs; the first represents the user agent
640     # Accept-Language header locale, and the second represents
641     # the fully-qualified path for the corresponding PO file that
642     # contains the messages.
643     #
644     # If you enable two or more locales, then users will be able to
645     # select their preferred locale from a locale picker in the TPAC.
646     #
647     #PerlAddVar OILSWebLocale "en"
648     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/messages.en.po"
649     #PerlAddVar OILSWebLocale "en_ca"
650     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/en-CA.po"
651     #PerlAddVar OILSWebLocale "fr_ca"
652     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/fr-CA.po"
653
654     # Set the default locale: defaults to en-US
655     #PerlAddVar OILSWebDefaultLocale "fr_ca"
656     
657     # Templates will be loaded from the following paths in reverse order.
658     PerlAddVar OILSWebTemplatePath "@localstatedir@/templates"
659     #PerlAddVar OILSWebTemplatePath "@localstatedir@/templates_localskin"
660
661     #-------------------------------------------------
662     # Added Content Configuration
663     #-------------------------------------------------
664     # Content Cafe
665     #SetEnv OILS_CONTENT_CAFE_USER MYUSER
666     #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
667     
668     # LibraryThing
669     #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
670     #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
671     
672     # ChiliFresh
673     #SetEnv OILS_CHILIFRESH_ACCOUNT
674     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
675     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
676
677     # Novelist
678     # SetEnv OILS_NOVELIST_URL http://imageserver.ebscohost.com/novelistselect/ns2init.js
679     # SetEnv OILS_NOVELIST_PROFILE <profile>
680     # SetEnv OILS_NOVELIST_PASSWORD <password>
681
682     #-------------------------------------------------
683
684     <IfModule mod_deflate.c>
685         SetOutputFilter DEFLATE
686         BrowserMatch ^Mozilla/4 gzip-only-text/html
687         BrowserMatch ^Mozilla/4\.0[678] no-gzip
688         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
689         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
690         <IfModule mod_headers.c>
691             Header append Cache-Control "public"
692             Header append Vary User-Agent env=!dont-vary
693         </IfModule>
694     </IfModule>
695 </Location>
696 <LocationMatch ^/(images|css|js)/>
697     # should pick up the default expire time from eg.conf...
698     <IfModule mod_deflate.c>
699         SetOutputFilter DEFLATE
700         BrowserMatch ^Mozilla/4 gzip-only-text/html
701         BrowserMatch ^Mozilla/4\.0[678] no-gzip
702         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
703         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
704         <IfModule mod_headers.c>
705             Header append Cache-Control "public"
706             Header append Vary User-Agent env=!dont-vary
707         </IfModule>
708     </IfModule>
709 </LocationMatch>
710 <Location /eg/opac>
711     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
712     # Expire the HTML quickly since we're loading dynamic data for each page
713     ExpiresActive On
714     ExpiresByType text/html "access plus 5 seconds"
715 </Location>
716 <Location /eg/kpac>
717     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader"
718     PerlSetVar KPacConfigFile "@sysconfdir@/kpac.xml.example"
719     ExpiresActive On
720     ExpiresByType text/html "access plus 5 seconds"
721 </Location>
722
723 # Note: the template processor will decline handling anything it does not
724 # have an explicit configuration for, which means it will fall back to 
725 # Apache to serve the file.  However, in the interest of speed, go ahead 
726 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
727 # Add more exemptions as needed.
728 <LocationMatch ^/eg/.*(\.js|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
729     SetHandler None
730 </LocationMatch>
731
732 # ----------------------------------------------------------------------------------
733 # Some mod_deflate logging setup
734 # ----------------------------------------------------------------------------------
735 <IfModule mod_deflate.c>
736     DeflateFilterNote Input instream
737     DeflateFilterNote Output outstream
738     DeflateFilterNote Ratio ratio
739
740     LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
741     CustomLog /var/log/apache2/deflate_log deflate
742
743     # There are problems with XMLENT and mod_deflate - so lets disable it
744     # This is where we don't have a pre-existing LocationMatch directive earlier
745     <LocationMatch /opac/.*\.xml$>
746         SetEnv no-gzip
747     </LocationMatch>
748     <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
749         SetEnv no-gzip
750     </LocationMatch>
751     <LocationMatch /reports/.*\.xhtml$>
752         SetEnv no-gzip
753     </LocationMatch>
754     <LocationMatch /conify/.*\.html$>
755         SetEnv no-gzip
756     </LocationMatch>
757 </IfModule>
758
759
760 <Location /IDL2js>
761
762     SetHandler perl-script
763     PerlHandler OpenILS::WWW::IDL2js
764     Options +ExecCGI
765     PerlSendHeader On
766     Require all granted 
767
768     <IfModule mod_headers.c>
769         Header append Cache-Control "public"
770     </IFModule>
771
772     <IfModule mod_deflate.c>
773         SetOutputFilter DEFLATE
774         BrowserMatch ^Mozilla/4 gzip-only-text/html
775         BrowserMatch ^Mozilla/4\.0[678] no-gzip
776         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
777         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
778         <IfModule mod_headers.c>
779             Header append Vary User-Agent env=!dont-vary
780         </IfModule>
781     </IfModule>
782 </Location>
783
784 # Uncomment the following to force SSL for everything. Note that this defeats caching
785 # and you will suffer a performance hit.
786 #RewriteCond %{HTTPS} off
787 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]