]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/apache/eg_vhost.conf
Patch from Ben Ostrowsky <ben@esilibrary.com> to specify "staff account" in proxied...
[Evergreen.git] / Open-ILS / examples / apache / eg_vhost.conf
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 ^/$ /opac/en-US/skin/default/xml/index.xml
10
11 # ----------------------------------------------------------------------------------
12 # Assign a default locale to the accessible OPAC
13 # ----------------------------------------------------------------------------------
14 RedirectMatch 301 ^/opac/extras/slimpac/start.html$ /opac/en-US/extras/slimpac/start.html
15 RedirectMatch 301 ^/opac/extras/slimpac/advanced.html$ /opac/en-US/extras/slimpac/advanced.html
16
17 # ----------------------------------------------------------------------------------
18 # Configure the gateway
19 # ----------------------------------------------------------------------------------
20 OSRFGatewayConfig /openils/conf/opensrf_core.xml
21 # Translator memcache server.  Default is localhost
22 # OSRFTranslatorCacheServer 127.0.0.1:11211
23
24
25 # ----------------------------------------------------------------------------------
26 # Added content plugin
27 # ----------------------------------------------------------------------------------
28 <Location /opac/extras/ac/>
29     SetHandler perl-script
30     PerlHandler OpenILS::WWW::AddedContent
31     Options +ExecCGI
32     PerlSendHeader On
33     allow from all
34 </Location>
35
36 # ----------------------------------------------------------------------------------
37 # Replace broken cover images with a transparent GIF by default
38 # ----------------------------------------------------------------------------------
39 RewriteEngine ON
40 RewriteRule ^/opac/extras/ac/jacket/(small|medium|large)/$ \
41     /opac/images/blank.png [P,L]
42
43 # ----------------------------------------------------------------------------------
44 # Add the row ID (RID) and date so we can make unAPI happy
45 # ----------------------------------------------------------------------------------
46 RewriteEngine ON
47 RewriteCond %{QUERY_STRING} (^r|&r)=(\d+)
48 RewriteRule - - [E=OILS_OPAC_RID:%2]
49 RewriteRule - - [E=OILS_TIME_YEAR:%{TIME_YEAR}] [L]
50
51 # ----------------------------------------------------------------------------------
52 # Pull the locale from the URL
53 # ----------------------------------------------------------------------------------
54 RewriteEngine ON
55 RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
56 RewriteRule - - [E=locale:%1] [L]
57
58 # ----------------------------------------------------------------------------------
59 # Configure the OPAC
60 # ----------------------------------------------------------------------------------
61 <LocationMatch /opac/>
62     AddType application/xhtml+xml .xml
63    
64     # - configure mod_xmlent
65     XMLEntStripPI "yes"
66     XMLEntEscapeScript "no"
67     XMLEntStripComments "yes"
68     XMLEntContentType "text/html; charset=utf-8"
69     # forces quirks mode which we want for now
70     XMLEntStripDoctype "yes" 
71
72     # - set up the include handlers
73     Options +Includes
74     AddOutputFilter INCLUDES .xsl
75     AddOutputFilter INCLUDES;XMLENT .xml
76                     
77     SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
78     
79     # This gives you the option to configure a different host to serve OPAC images from
80     # Specify the hostname (without protocol) and path to the images.  Protocol will
81     # be determined at runtime
82     #SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=static.example.org/opac/
83
84     # In addition to loading images from a static host, you can also load CSS and/or
85     # Javascript from a static host or hosts. Protocol will be determined at runtime
86     # and/or by configuration options immediately following.
87     #SetEnvIf Request_URI ".*" OILS_OPAC_CSS_HOST=static.example.org/opac/
88     #SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=static.example.org/opac/
89
90     # If you are not able to serve static content via https and 
91     # wish to force http:// (and are comfortable with mixed-content
92     # warnings in client browsers), set this:
93     #SetEnvIf Request_URI ".*" OILS_OPAC_STATIC_PROTOCOL=http
94
95     # If you would prefer to fall back to your non-static servers for 
96     # https pages, avoiding mixed-content warnings in client browsers
97     # and are willing to accept some increased server load, set this:
98     #SetEnvIf Request_URI ".*" OILS_OPAC_BYPASS_STATIC_FOR_HTTPS=yes
99
100     # Specify a ChiliFresh account to integrate their services with the OPAC
101     #SetEnv OILS_CHILIFRESH_ACCOUNT
102     #SetEnv OILS_CHILIFRESH_PROFILE
103     #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
104
105     # Specify the initial script URL for Novelist (containing account credentials, etc.)
106     #SetEnv OILS_NOVELIST_URL
107     
108
109     # Uncomment to force SSL any time a patron is logged in.  This protects 
110     # authentication tokens.  Left commented out for backwards compat for now.
111     #SetEnv OILS_OPAC_FORCE_LOGIN_SSL 1
112
113 </LocationMatch>
114
115
116 # ----------------------------------------------------------------------------------
117 # Force SSL on the OPAC's "My Account" page
118 # ----------------------------------------------------------------------------------
119 <LocationMatch .*/myopac.xml>
120     SSLRequireSSL
121 </LocationMatch>
122
123 <LocationMatch /opac/extras/>
124     # Force to en-US for now to satisfy bbags.xml
125     SetEnv locale en-US
126     Options +Includes
127     AddOutputFilter INCLUDES .xml
128     AddType application/xhtml+xml .xml
129 </LocationMatch>
130
131 RewriteEngine ON
132 RewriteCond %{QUERY_STRING} locale=([^&]*)
133 RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
134 <LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
135     AddOutputFilter INCLUDES;XMLENT .html
136 </LocationMatch>
137
138 # ----------------------------------------------------------------------------------
139 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
140 # ----------------------------------------------------------------------------------
141 RewriteEngine ON
142 RewriteCond %{HTTP:Accept-Language} ([a-z]{2}-[A-Z]{2})
143 RewriteRule ^/xul/      -       [E=locale:%1]
144 RewriteRule ^/reports/  -       [E=locale:%1] [L]
145
146 # Default to en-US if we haven't matched a locale of the form xx-YY 
147 RewriteEngine ON
148 RewriteCond %{HTTP:Accept-Language} !([a-z]{2}-[A-Z]{2})
149 RewriteRule ^/xul/      -       [E=locale:en-US]
150 RewriteRule ^/reports/  -       [E=locale:en-US] [L]
151
152 # Default to en-US if we are just given en
153 RewriteEngine ON
154 RewriteCond %{ENV:locale} ^$ [OR]
155 RewriteCond %{ENV:locale} ^en$
156 RewriteRule - - [E=locale:en-US] [L]
157
158 <LocationMatch /xul/.*\.x?html$>
159     Options +Includes
160     XMLEntEscapeScript "no"
161     XMLEntStripComments "yes"
162     XMLEntStripPI "yes"
163     XMLEntStripDoctype "yes"
164     XMLEntContentType "text/html; charset=utf-8"
165     AddOutputFilter INCLUDES;XMLENT .xhtml
166     AddOutputFilter INCLUDES;XMLENT .html
167     allow from all
168 </LocationMatch>
169
170
171 <LocationMatch /xul/.*\.xul$>
172     Options +Includes
173     XMLEntContentType "application/vnd.mozilla.xul+xml"
174     AddOutputFilter INCLUDES;XMLENT .xul
175     allow from all
176 </LocationMatch>
177
178 # ----------------------------------------------------------------------------------
179 # Self-serve password interface
180 # ----------------------------------------------------------------------------------
181 <Location /opac/password>
182     SetHandler perl-script
183     PerlHandler OpenILS::WWW::PasswordReset::password_reset
184     Options +ExecCGI
185     PerlSendHeader On
186     allow from all
187
188     # Force clients to use HTTPS
189     RewriteEngine On
190     RewriteCond %{HTTPS} !=on [NC]
191     RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
192 </Location>
193
194 # ----------------------------------------------------------------------------------
195 # Supercat feeds
196 # ----------------------------------------------------------------------------------
197 <Location /opac/extras/oisbn>
198     SetHandler perl-script
199     PerlHandler OpenILS::WWW::SuperCat::oisbn
200     Options +ExecCGI
201     PerlSendHeader On
202     allow from all
203 </Location>
204 <Location /opac/extras/supercat>
205     SetHandler perl-script
206     PerlHandler OpenILS::WWW::SuperCat::supercat
207     Options +ExecCGI
208     PerlSendHeader On
209     allow from all
210 </Location>
211 <Location /opac/extras/unapi>
212     SetHandler perl-script
213     PerlHandler OpenILS::WWW::SuperCat::unapi
214     Options +ExecCGI
215     PerlSendHeader On
216     allow from all
217 </Location>
218 <Location /opac/extras/feed/bookbag>
219     SetHandler perl-script
220     PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
221     Options +ExecCGI
222     PerlSendHeader On
223     allow from all
224 </Location>
225 <Location /opac/extras/opensearch>
226     SetHandler perl-script
227     PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
228     Options +ExecCGI
229     PerlSendHeader On
230     allow from all
231 </Location>
232 <Location /opac/extras/sru>
233     SetHandler perl-script
234     PerlHandler OpenILS::WWW::SuperCat::sru_search
235     Options +ExecCGI
236     PerlSendHeader On
237     allow from all
238 </Location>
239 <Location /opac/extras/feed/freshmeat>
240     SetHandler perl-script
241     PerlHandler OpenILS::WWW::SuperCat::changes_feed
242     Options +ExecCGI
243     PerlSendHeader On
244     allow from all
245 </Location>
246 <Location /opac/extras/browse>
247     SetHandler perl-script
248     PerlHandler OpenILS::WWW::SuperCat::string_browse
249     Options +ExecCGI
250     PerlSendHeader On
251     allow from all
252 </Location>     
253 <Location /opac/extras/startwith>
254     SetHandler perl-script
255     PerlHandler OpenILS::WWW::SuperCat::string_startwith
256     Options +ExecCGI
257     PerlSendHeader On
258     allow from all
259 </Location>     
260         
261 # ----------------------------------------------------------------------------------
262 # Module for displaying OpenSRF API documentation
263 # ----------------------------------------------------------------------------------
264 <Location /opac/extras/docgen.xsl>
265     AddOutputFilter INCLUDES .xsl
266 </Location>
267
268 # ----------------------------------------------------------------------------------
269 # Module for processing staff-client offline scripts lives here
270 # ----------------------------------------------------------------------------------
271 <Directory "/openils/var/cgi-bin/offline">
272     AddHandler cgi-script .pl
273     AllowOverride None
274     Options +ExecCGI
275     allow from all
276 </Directory>
277         
278         
279 # ----------------------------------------------------------------------------------
280 # XXX Note, it's important to explicitly set the JSON encoding style 
281 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change 
282 # with OpenSRF 1.0
283 # ----------------------------------------------------------------------------------
284 # OpenSRF JSON legacy gateway
285 # ----------------------------------------------------------------------------------
286 <Location /gateway>
287     SetHandler osrf_json_gateway_module
288     OSRFGatewayLegacyJSON "true"
289     allow from all
290 </Location>
291 # ----------------------------------------------------------------------------------
292 # New-style OpenSRF JSON gateway
293 # ----------------------------------------------------------------------------------
294 <Location /osrf-gateway-v1>
295     SetHandler osrf_json_gateway_module
296     OSRFGatewayLegacyJSON "false"
297     allow from all
298 </Location>
299
300 # ----------------------------------------------------------------------------------
301 # OpenSRF-over-HTTP translator
302 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
303 # ----------------------------------------------------------------------------------
304 <Location /osrf-http-translator>
305     SetHandler osrf_http_translator_module
306     allow from all
307 </Location>
308
309 # ----------------------------------------------------------------------------------
310 # The exporter lives here
311 # ----------------------------------------------------------------------------------
312 <Location /exporter>
313     SetHandler perl-script
314     PerlSetVar OILSProxyTitle "Exporter Login"
315     PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to export records"
316     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
317     PerlHandler OpenILS::WWW::Proxy OpenILS::WWW::Exporter
318     Options +ExecCGI
319     PerlSendHeader On
320     allow from all
321 </Location>
322
323 # ----------------------------------------------------------------------------------
324 # Reporting output lives here
325 # ----------------------------------------------------------------------------------
326 <Location /reporter/>
327     SetHandler perl-script
328     PerlSetVar OILSProxyTitle "Report Login"
329     PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to view this report"
330     PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
331     PerlHandler OpenILS::WWW::Proxy
332     Options +ExecCGI
333     PerlSendHeader On
334     allow from all
335 </Location>
336
337 # ----------------------------------------------------------------------------------
338 # Selfcheck interface
339 # ----------------------------------------------------------------------------------
340 <LocationMatch .*/selfcheck.xml>
341     SetHandler perl-script
342     PerlSetVar OILSProxyTitle "Self-check Login"
343     PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to activate the self-check interface"
344     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
345     PerlHandler OpenILS::WWW::Proxy
346     Options +ExecCGI
347     PerlSendHeader On
348     allow from all
349 </LocationMatch>
350
351
352 # ----------------------------------------------------------------------------------
353 # Reports GUI
354 # ----------------------------------------------------------------------------------
355 <LocationMatch /reports>
356     Options +Includes
357     AddOutputFilter INCLUDES;XMLENT .xhtml
358 </LocationMatch>
359
360 <LocationMatch /reports/fm_IDL.xml>
361     IDLChunkStripPI "yes"
362     IDLChunkEscapeScript "no"
363     IDLChunkStripComments "yes"
364     IDLChunkStripDoctype "yes"
365     IDLChunkContentType "application/xml; charset=utf-8"
366     AddOutputFilter INCLUDES;IDLCHUNK .xml
367 </LocationMatch>
368
369 # ----------------------------------------------------------------------------------
370 # XML-RPC gateway
371 # ----------------------------------------------------------------------------------
372 <Location /xml-rpc>
373     SetHandler perl-script
374     PerlHandler OpenILS::WWW::XMLRPCGateway
375     Options +ExecCGI
376     PerlSendHeader On
377     allow from all
378 </Location>
379
380 # ----------------------------------------------------------------------------------
381 # Conify - next-generation Evergreen administration interface
382 # ----------------------------------------------------------------------------------
383 RewriteEngine on
384 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
385 <Location /conify>
386     Options +Includes
387     XMLEntStripPI "yes"
388     XMLEntEscapeScript "no"
389     XMLEntStripComments "no"
390     XMLEntContentType "text/html; charset=utf-8"
391     AddOutputFilter INCLUDES;XMLENT .html
392  
393     SetHandler perl-script
394     PerlSetVar OILSProxyTitle "Dojo Admin Login"
395     PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to administer Evergreen"
396     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
397     PerlHandler OpenILS::WWW::Proxy
398     Options +ExecCGI
399     PerlSendHeader On
400     allow from all
401 </Location>
402
403 # ----------------------------------------------------------------------------------
404 # Vandelay importers / exporters (your Web interface to bibliographic travel)
405 # ----------------------------------------------------------------------------------
406 RedirectMatch 301 ^/vandelay/vandelay.xml(.*)$ /vandelay/en-US/vandelay.xml$1
407
408 RewriteEngine on
409 RewriteRule ^/vandelay/([a-z]{2}-[A-Z]{2})/(.*)$ /vandelay/$2 [E=locale:$1]
410
411 <LocationMatch /vandelay.*xml>
412     XMLEntStripPI "yes"
413     XMLEntEscapeScript "no"
414     XMLEntStripComments "yes"
415     XMLEntContentType "text/html; charset=utf-8"
416     XMLEntStripDoctype "yes"
417     AddOutputFilter INCLUDES;XMLENT .xml
418         SetHandler perl-script
419         PerlSetVar OILSProxyTitle "Vandelay Login"
420         PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to import MARC records"
421         PerlSetVar OILSProxyPermissions "IMPORT_MARC"
422         PerlHandler OpenILS::WWW::Proxy
423         Options +ExecCGI
424         PerlSendHeader On
425         allow from all
426 </LocationMatch>
427 <Location /vandelay-upload>
428     SetHandler perl-script
429     PerlHandler OpenILS::WWW::Vandelay::spool_marc
430     Options +ExecCGI
431     allow from all
432 </Location>
433
434 # OpenURL 0.1 searching based on OpenSearch
435 RewriteEngine on
436 RewriteMap openurl prg:/openils/bin/openurl_map.pl
437 RewriteCond %{QUERY_STRING} (^.*$)
438 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
439
440
441
442 # General Evergreen web template processor
443 <Location /eg>
444     SetHandler perl-script
445     PerlHandler OpenILS::WWW::EGWeb
446     Options +ExecCGI
447     PerlSendHeader On
448     allow from all
449 </Location>
450 # Note: the template processor will decline handling anything it does not
451 # have an explicit configuration for, which means it will fall back to 
452 # Apache to serve the file.  However, in the interest of speed, go ahead 
453 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
454 # Add more exemptions as needed.
455 <LocationMatch ^/eg/.*(\.js|\.css|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
456     SetHandler None
457 </LocationMatch>
458
459