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