]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/apache/eg_vhost.conf.in
Add apache config examples for AC by record id
[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 # ----------------------------------------------------------------------------------
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     allow from all
52 </Location>
53
54 # Autosuggest for searches
55 <Location /opac/extras/autosuggest>
56     SetHandler perl-script
57     PerlHandler OpenILS::WWW::AutoSuggest
58     PerlSendHeader On
59     Allow from All
60 </Location>
61
62 # Flattener service
63 <Location /opac/extras/flattener>
64     SetHandler perl-script
65     PerlHandler OpenILS::WWW::FlatFielder
66     PerlSendHeader On
67     Allow from All
68 </Location>
69
70 # ----------------------------------------------------------------------------------
71 # Replace broken cover images with a transparent GIF by default
72 # ----------------------------------------------------------------------------------
73 RewriteEngine ON
74 RewriteRule ^/opac/extras/ac/jacket/(small|medium|large)/$ \
75     /opac/images/blank.png [P,L]
76
77 <Location /opac/extras/ac/jacket>
78         ErrorDocument 404 /opac/images/blank.png
79 </Location>
80
81 # ----------------------------------------------------------------------------------
82 # Add the row ID (RID) and date so we can make unAPI happy
83 # ----------------------------------------------------------------------------------
84 RewriteCond %{QUERY_STRING} (^r|&r)=(\d+)
85 RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}]
86
87 # ----------------------------------------------------------------------------------
88 # Pull the locale from the URL
89 # ----------------------------------------------------------------------------------
90 RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
91 RewriteRule . - [E=locale:%1]
92
93 # ----------------------------------------------------------------------------------
94 # Rewrite JSPac->TPac with redirects
95 # ----------------------------------------------------------------------------------
96
97 # First things first, extract useful data
98 # And we are going to start with a "this is the JSPac" check on each of these:
99 # RewriteCond %{REQUEST_URI} ^/?opac/
100
101 # Basic (overall) search type, if present
102 # I am cheating and grabbing RT or TP because I dunno the difference between them.
103 RewriteCond %{REQUEST_URI} ^/opac/
104 RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])(rt|tp)=([^;&]*)
105 RewriteRule . - [E=OILS_JSPAC_SEARCH_TYPE:qtype=%3;]
106
107 # Basic (overall) search term(s), if present - NOTE: Not doing advanced search.
108 RewriteCond %{REQUEST_URI} ^/opac/
109 RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])t=([^;&]*)
110 RewriteRule . - [E=OILS_JSPAC_SEARCH_TERMS:query=%2;]
111
112 # Search Location, if present
113 RewriteCond %{REQUEST_URI} ^/opac/
114 RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])l=([^;&]*)
115 RewriteRule . - [E=OILS_JSPAC_SEARCH_LOCATION:locg=%2;]
116
117 # My Account
118 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]
119
120 # Record Pages
121 # /opac/en-US/skin/default/xml/rdetail.xml?r=32 -> /eg/opac/record/32
122 RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])r=([^;&]*)
123 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]
124
125 # Bookbag Pages
126 # /opac/extras/feed/bookbag/html-full/1 -> /eg/opac/results?bookbag=1;page=0;locg=1;depth=0
127 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]
128
129 # Search Results Pages
130 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]
131
132 # Basic Search (STILL not doing advanced)
133 # Fallback! But only for things that end in xml, htm, or html
134 # Images, CSS, etc can stick around.
135 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]
136
137 # ----------------------------------------------------------------------------------
138 # For sanity reasons, default indexes to Off
139 # ----------------------------------------------------------------------------------
140 Options -Indexes
141
142 # ----------------------------------------------------------------------------------
143 # Configure the OPAC
144 # ----------------------------------------------------------------------------------
145 <LocationMatch /opac/>
146     AddType application/xhtml+xml .xml
147    
148     # - configure mod_xmlent
149     XMLEntStripPI "yes"
150     XMLEntEscapeScript "no"
151     XMLEntStripComments "yes"
152     XMLEntContentType "text/html; charset=utf-8"
153     # forces quirks mode which we want for now
154     XMLEntStripDoctype "yes" 
155
156     # - set up the include handlers
157     Options +Includes
158     AddOutputFilter INCLUDES .xsl
159     AddOutputFilter INCLUDES;XMLENT .xml
160                     
161     SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
162     
163     # This gives you the option to configure a different host to serve OPAC images from
164     # Specify the hostname (without protocol) and path to the images.  Protocol will
165     # be determined at runtime
166     #SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=static.example.org/opac/
167
168     # In addition to loading images from a static host, you can also load CSS and/or
169     # Javascript from a static host or hosts. Protocol will be determined at runtime
170     # and/or by configuration options immediately following.
171     #SetEnvIf Request_URI ".*" OILS_OPAC_CSS_HOST=static.example.org/opac/
172     #SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=static.example.org/opac/
173
174     # If you are not able to serve static content via https and 
175     # wish to force http:// (and are comfortable with mixed-content
176     # warnings in client browsers), set this:
177     #SetEnvIf Request_URI ".*" OILS_OPAC_STATIC_PROTOCOL=http
178
179     # If you would prefer to fall back to your non-static servers for 
180     # https pages, avoiding mixed-content warnings in client browsers
181     # and are willing to accept some increased server load, set this:
182     #SetEnvIf Request_URI ".*" OILS_OPAC_BYPASS_STATIC_FOR_HTTPS=yes
183
184     # Specify a ChiliFresh account to integrate their services with the OPAC
185     #SetEnv OILS_CHILIFRESH_ACCOUNT
186     #SetEnv OILS_CHILIFRESH_PROFILE
187     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
188     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
189
190     # Specify the initial script URL for Novelist (containing account credentials, etc.)
191     #SetEnv OILS_NOVELIST_URL
192     #
193
194     # Uncomment to force SSL any time a patron is logged in.  This protects 
195     # authentication tokens.  Left commented out for backwards compat for now.
196     #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
197
198     # If set, the skin uses the combined JS file at $SKINDIR/js/combined.js
199     #SetEnv OILS_OPAC_COMBINED_JS 1
200
201 </LocationMatch>
202
203 <Location /opac/>
204     # ----------------------------------------------------------------------------------
205     # Some mod_deflate fun
206     # ----------------------------------------------------------------------------------
207     <IfModule mod_deflate.c>
208         SetOutputFilter DEFLATE
209
210         BrowserMatch ^Mozilla/4 gzip-only-text/html
211         BrowserMatch ^Mozilla/4\.0[678] no-gzip
212         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
213
214         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
215
216         <IfModule mod_headers.c>
217             Header append Vary User-Agent env=!dont-vary
218         </IfModule>
219     </IfModule>
220
221 </Location>
222
223 <Location //opac/>
224     # ----------------------------------------------------------------------------------
225     # Some mod_deflate fun
226     # ----------------------------------------------------------------------------------
227     <IfModule mod_deflate.c>
228         SetOutputFilter DEFLATE
229
230         BrowserMatch ^Mozilla/4 gzip-only-text/html
231         BrowserMatch ^Mozilla/4\.0[678] no-gzip
232         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
233
234         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
235
236         <IfModule mod_headers.c>
237             Header append Vary User-Agent env=!dont-vary
238         </IfModule>
239     </IfModule>
240
241 </Location>
242
243 # ----------------------------------------------------------------------------------
244 # Force SSL on the OPAC's "My Account" page
245 # ----------------------------------------------------------------------------------
246 <LocationMatch .*/myopac.xml>
247     SSLRequireSSL
248 </LocationMatch>
249
250 <LocationMatch /opac/extras/>
251     # Force to en-US for now to satisfy bbags.xml
252     SetEnv locale en-US
253     Options +Includes
254     AddOutputFilter INCLUDES .xml
255     AddType application/xhtml+xml .xml
256 </LocationMatch>
257
258 RewriteCond %{QUERY_STRING} locale=([^&]*)
259 RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /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 # ----------------------------------------------------------------------------------
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     allow from all
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     allow from all
508 </LocationMatch>
509
510
511 # ----------------------------------------------------------------------------------
512 # Reports GUI
513 # ----------------------------------------------------------------------------------
514 <LocationMatch /reports>
515     Options +Includes
516     AddOutputFilter INCLUDES;XMLENT .xhtml
517 </LocationMatch>
518
519 # capture locale CGI param for /reports/fm_IDL.xml
520 RewriteCond %{REQUEST_URI} ^/reports/fm_IDL.xml
521 RewriteCond %{QUERY_STRING} locale=([^&;]*)
522 RewriteRule . - [E=locale:%1]
523
524 <LocationMatch /reports/fm_IDL.xml>
525     IDLChunkStripPI "yes"
526     IDLChunkEscapeScript "no"
527     IDLChunkStripComments "yes"
528     IDLChunkStripDoctype "yes"
529     IDLChunkContentType "application/xml; charset=utf-8"
530     AddOutputFilter INCLUDES;IDLCHUNK .xml
531 </LocationMatch>
532
533 # ----------------------------------------------------------------------------------
534 # EDI Message viewer
535 # ----------------------------------------------------------------------------------
536 <Location /edi>
537     SetHandler perl-script
538     PerlHandler OpenILS::WWW::EDI
539     Options +ExecCGI
540     PerlSendHeader On
541     allow from all
542 </Location>     
543
544 # ----------------------------------------------------------------------------------
545 # XML-RPC gateway
546 # ----------------------------------------------------------------------------------
547 <Location /xml-rpc>
548     SetHandler perl-script
549     PerlHandler OpenILS::WWW::XMLRPCGateway
550     Options +ExecCGI
551     PerlSendHeader On
552     allow from all
553     <IfModule mod_headers.c>
554         Header onsuccess set Cache-Control no-cache
555     </IfModule>
556 </Location>
557
558 # ----------------------------------------------------------------------------------
559 # Conify - next-generation Evergreen administration interface
560 # ----------------------------------------------------------------------------------
561 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
562 <Location /conify>
563     Options +Includes
564     XMLEntStripPI "yes"
565     XMLEntEscapeScript "no"
566     XMLEntStripComments "no"
567     XMLEntContentType "text/html; charset=utf-8"
568     AddOutputFilter INCLUDES;XMLENT .html
569  
570     AuthType Basic
571     AuthName "Dojo Admin Login"
572     PerlOptions +GlobalRequest
573     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
574     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
575     require valid-user
576     Options +ExecCGI
577     PerlSendHeader On
578     allow from all
579 </Location>
580
581 # ----------------------------------------------------------------------------------
582 # The PhoneList lives here
583 # ----------------------------------------------------------------------------------
584 <Location /phonelist>
585     SetHandler perl-script
586     AuthType Basic
587     AuthName "PhoneList Login"
588     require valid-user
589     PerlOptions +GlobalRequest
590     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
591     PerlHandler OpenILS::WWW::PhoneList
592     PerlAuthenHandler OpenILS::WWW::Proxy::Authen
593     Options +ExecCGI
594     PerlSendHeader On
595     allow from all
596     <IfModule mod_headers.c>
597         Header onsuccess set Cache-Control no-cache
598     </IfModule>
599 </Location>
600 <Location /vandelay-upload>
601     SetHandler perl-script
602     PerlHandler OpenILS::WWW::Vandelay::spool_marc
603     Options +ExecCGI
604     allow from all
605 </Location>
606
607 # OpenURL 0.1 searching based on OpenSearch
608 RewriteMap openurl prg:@bindir@/openurl_map.pl
609 RewriteCond %{QUERY_STRING} (^.*$)
610 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
611
612
613
614 # General Evergreen web template processor
615 <Location /eg>
616     SetHandler perl-script
617     PerlHandler OpenILS::WWW::EGWeb
618     Options +ExecCGI
619     PerlSendHeader On
620     allow from all
621
622     PerlSetVar OILSWebBasePath "/eg"
623     PerlSetVar OILSWebWebDir "@localstatedir@/web"
624     PerlSetVar OILSWebDefaultTemplateExtension "tt2"
625
626     # Enable Template-Toolkit error debugging messages (apache error log)
627     PerlSetVar OILSWebDebugTemplate "true"
628
629     # -------------------------------------------------------
630     # Media Prefix.  In the 3rd example, the protocol (http) is enforced
631     #PerlSetVar OILSWebMediaPrefix "/media"
632     #PerlSetVar OILSWebMediaPrefix "static.example.com/media"
633     #PerlSetVar OILSWebMediaPrefix "http://static.example.com/media"
634
635     # Locale messages files:
636     #
637     # These appear in pairs; the first represents the user agent
638     # Accept-Language header locale, and the second represents
639     # the fully-qualified path for the corresponding PO file that
640     # contains the messages.
641     #
642     # If you enable two or more locales, then users will be able to
643     # select their preferred locale from a locale picker in the TPAC.
644     #
645     #PerlAddVar OILSWebLocale "en"
646     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/messages.en.po"
647     #PerlAddVar OILSWebLocale "en_ca"
648     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/en-CA.po"
649     #PerlAddVar OILSWebLocale "fr_ca"
650     #PerlAddVar OILSWebLocale "@localstatedir@/data/locale/fr-CA.po"
651
652     # Set the default locale: defaults to en-US
653     #PerlAddVar OILSWebDefaultLocale "fr_ca"
654     
655     # Templates will be loaded from the following paths in reverse order.
656     PerlAddVar OILSWebTemplatePath "@localstatedir@/templates"
657     #PerlAddVar OILSWebTemplatePath "@localstatedir@/templates_localskin"
658
659     #-------------------------------------------------
660     # Added Content Configuration
661     #-------------------------------------------------
662     # Content Cafe
663     #SetEnv OILS_CONTENT_CAFE_USER MYUSER
664     #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
665     
666     # LibraryThing
667     #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
668     #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
669     
670     # ChiliFresh
671     #SetEnv OILS_CHILIFRESH_ACCOUNT
672     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
673     #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
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 logging setup
726 # ----------------------------------------------------------------------------------
727 <IfModule mod_deflate.c>
728     DeflateFilterNote Input instream
729     DeflateFilterNote Output outstream
730     DeflateFilterNote Ratio ratio
731
732     LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
733     CustomLog /var/log/apache2/deflate_log deflate
734
735     # There are problems with XMLENT and mod_deflate - so lets disable it
736     # This is where we don't have a pre-existing LocationMatch directive earlier
737     <LocationMatch /opac/.*\.xml$>
738         SetEnv no-gzip
739     </LocationMatch>
740     <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/.*\.html$>
741         SetEnv no-gzip
742     </LocationMatch>
743     <LocationMatch /reports/.*\.xhtml$>
744         SetEnv no-gzip
745     </LocationMatch>
746     <LocationMatch /conify/.*\.html$>
747         SetEnv no-gzip
748     </LocationMatch>
749 </IfModule>
750
751
752 <Location /IDL2js>
753
754     SetHandler perl-script
755     PerlHandler OpenILS::WWW::IDL2js
756     Options +ExecCGI
757     PerlSendHeader On
758     allow from all
759
760     <IfModule mod_headers.c>
761         Header append Cache-Control "public"
762     </IFModule>
763
764     <IfModule mod_deflate.c>
765         SetOutputFilter DEFLATE
766         BrowserMatch ^Mozilla/4 gzip-only-text/html
767         BrowserMatch ^Mozilla/4\.0[678] no-gzip
768         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
769         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
770         <IfModule mod_headers.c>
771             Header append Vary User-Agent env=!dont-vary
772         </IfModule>
773     </IfModule>
774 </Location>
775
776 # Uncomment the following to force SSL for everything. Note that this defeats caching
777 # and you will suffer a performance hit.
778 #RewriteCond %{HTTPS} off
779 #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L]