]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/examples/apache/eg_vhost.conf
explicitly allow SSI for these locations. Important for Apache on Redhat, etc.
[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 # Self-serve password interface
168 # ----------------------------------------------------------------------------------
169 <Location /opac/password>
170     SetHandler perl-script
171     PerlHandler OpenILS::WWW::PasswordReset::password_reset
172     Options +ExecCGI
173     PerlSendHeader On
174     allow from all
175
176     # Force clients to use HTTPS
177     RewriteEngine On
178     RewriteCond %{HTTPS} !=on [NC]
179     RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
180 </Location>
181
182 # ----------------------------------------------------------------------------------
183 # Supercat feeds
184 # ----------------------------------------------------------------------------------
185 <Location /opac/extras/oisbn>
186     SetHandler perl-script
187     PerlHandler OpenILS::WWW::SuperCat::oisbn
188     Options +ExecCGI
189     PerlSendHeader On
190     allow from all
191 </Location>
192 <Location /opac/extras/supercat>
193     SetHandler perl-script
194     PerlHandler OpenILS::WWW::SuperCat::supercat
195     Options +ExecCGI
196     PerlSendHeader On
197     allow from all
198 </Location>
199 <Location /opac/extras/unapi>
200     SetHandler perl-script
201     PerlHandler OpenILS::WWW::SuperCat::unapi
202     Options +ExecCGI
203     PerlSendHeader On
204     allow from all
205 </Location>
206 <Location /opac/extras/feed/bookbag>
207     SetHandler perl-script
208     PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
209     Options +ExecCGI
210     PerlSendHeader On
211     allow from all
212 </Location>
213 <Location /opac/extras/opensearch>
214     SetHandler perl-script
215     PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
216     Options +ExecCGI
217     PerlSendHeader On
218     allow from all
219 </Location>
220 <Location /opac/extras/sru>
221     SetHandler perl-script
222     PerlHandler OpenILS::WWW::SuperCat::sru_search
223     Options +ExecCGI
224     PerlSendHeader On
225     allow from all
226 </Location>
227 <Location /opac/extras/feed/freshmeat>
228     SetHandler perl-script
229     PerlHandler OpenILS::WWW::SuperCat::changes_feed
230     Options +ExecCGI
231     PerlSendHeader On
232     allow from all
233 </Location>
234 <Location /opac/extras/browse>
235     SetHandler perl-script
236     PerlHandler OpenILS::WWW::SuperCat::string_browse
237     Options +ExecCGI
238     PerlSendHeader On
239     allow from all
240 </Location>     
241         
242 # ----------------------------------------------------------------------------------
243 # Module for displaying OpenSRF API documentation
244 # ----------------------------------------------------------------------------------
245 <Location /opac/extras/docgen.xsl>
246     AddOutputFilter INCLUDES .xsl
247 </Location>
248
249 # ----------------------------------------------------------------------------------
250 # Module for processing staff-client offline scripts lives here
251 # ----------------------------------------------------------------------------------
252 <Directory "/openils/var/cgi-bin/offline">
253     AddHandler cgi-script .pl
254     AllowOverride None
255     Options +ExecCGI
256     allow from all
257 </Directory>
258         
259         
260 # ----------------------------------------------------------------------------------
261 # XXX Note, it's important to explicitly set the JSON encoding style 
262 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change 
263 # with OpenSRF 1.0
264 # ----------------------------------------------------------------------------------
265 # OpenSRF JSON legacy gateway
266 # ----------------------------------------------------------------------------------
267 <Location /gateway>
268     SetHandler osrf_json_gateway_module
269     OSRFGatewayLegacyJSON "true"
270     allow from all
271 </Location>
272 # ----------------------------------------------------------------------------------
273 # New-style OpenSRF JSON gateway
274 # ----------------------------------------------------------------------------------
275 <Location /osrf-gateway-v1>
276     SetHandler osrf_json_gateway_module
277     OSRFGatewayLegacyJSON "false"
278     allow from all
279 </Location>
280
281 # ----------------------------------------------------------------------------------
282 # OpenSRF-over-HTTP translator
283 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
284 # ----------------------------------------------------------------------------------
285 <Location /osrf-http-translator>
286     SetHandler osrf_http_translator_module
287     allow from all
288 </Location>
289
290 # ----------------------------------------------------------------------------------
291 # The exporter lives here
292 # ----------------------------------------------------------------------------------
293 <Location /exporter>
294     SetHandler perl-script
295     PerlSetVar OILSProxyTitle "Exporter Login"
296     PerlSetVar OILSProxyDescription "Please log in to export records"
297     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
298     PerlHandler OpenILS::WWW::Proxy OpenILS::WWW::Exporter
299     Options +ExecCGI
300     PerlSendHeader On
301     allow from all
302 </Location>
303
304 # ----------------------------------------------------------------------------------
305 # Reporting output lives here
306 # ----------------------------------------------------------------------------------
307 <Location /reporter/>
308     SetHandler perl-script
309     PerlSetVar OILSProxyTitle "Report Login"
310     PerlSetVar OILSProxyDescription "Please log in to view this report"
311     PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
312     PerlHandler OpenILS::WWW::Proxy
313     Options +ExecCGI
314     PerlSendHeader On
315     allow from all
316 </Location>
317
318 # ----------------------------------------------------------------------------------
319 # Selfcheck interface
320 # ----------------------------------------------------------------------------------
321 <LocationMatch .*/selfcheck.xml>
322     SetHandler perl-script
323     PerlSetVar OILSProxyTitle "Selfcheck Login"
324     PerlSetVar OILSProxyDescription "Please log in to activate the selfcheck interface"
325     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
326     PerlHandler OpenILS::WWW::Proxy
327     Options +ExecCGI
328     PerlSendHeader On
329     allow from all
330 </LocationMatch>
331
332
333 # ----------------------------------------------------------------------------------
334 # Reports GUI
335 # ----------------------------------------------------------------------------------
336 <LocationMatch /reports>
337     Options +Includes
338     AddOutputFilter INCLUDES;XMLENT .xhtml
339 </LocationMatch>
340
341 <LocationMatch /reports/fm_IDL.xml>
342     Options +Includes
343     IDLChunkStripPI "yes"
344     IDLChunkEscapeScript "no"
345     IDLChunkStripComments "yes"
346     IDLChunkStripDoctype "yes"
347     IDLChunkContentType "application/xml; charset=utf-8"
348     AddOutputFilter INCLUDES;IDLCHUNK .xml
349 </LocationMatch>
350
351 # ----------------------------------------------------------------------------------
352 # XML-RPC gateway
353 # ----------------------------------------------------------------------------------
354 <Location /xml-rpc>
355     SetHandler perl-script
356     PerlHandler OpenILS::WWW::XMLRPCGateway
357     Options +ExecCGI
358     PerlSendHeader On
359     allow from all
360 </Location>
361
362 # ----------------------------------------------------------------------------------
363 # Conify - next-generation Evergreen administration interface
364 # ----------------------------------------------------------------------------------
365 RewriteEngine on
366 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
367 <Location /conify>
368     Options +Includes
369     XMLEntStripPI "yes"
370     XMLEntEscapeScript "no"
371     XMLEntStripComments "no"
372     XMLEntContentType "text/html; charset=utf-8"
373     AddOutputFilter INCLUDES;XMLENT .html
374  
375     SetHandler perl-script
376     PerlSetVar OILSProxyTitle "Dojo Admin Login"
377     PerlSetVar OILSProxyDescription "Please log in to administer Evergreen"
378     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
379     PerlHandler OpenILS::WWW::Proxy
380     Options +ExecCGI
381     PerlSendHeader On
382     allow from all
383 </Location>
384
385 # ----------------------------------------------------------------------------------
386 # Vandelay importers / exporters (your Web interface to bibliographic travel)
387 # ----------------------------------------------------------------------------------
388 RedirectMatch 301 ^/vandelay/vandelay.xml(.*)$ /vandelay/en-US/vandelay.xml$1
389
390 RewriteEngine on
391 RewriteRule ^/vandelay/([a-z]{2}-[A-Z]{2})/(.*)$ /vandelay/$2 [E=locale:$1]
392
393 <LocationMatch /vandelay.*xml>
394     XMLEntStripPI "yes"
395     XMLEntEscapeScript "no"
396     XMLEntStripComments "yes"
397     XMLEntContentType "text/html; charset=utf-8"
398     XMLEntStripDoctype "yes"
399     AddOutputFilter INCLUDES;XMLENT .xml
400         SetHandler perl-script
401         PerlSetVar OILSProxyTitle "Vandelay Login"
402         PerlSetVar OILSProxyDescription "Please log in to import MARC records"
403         PerlSetVar OILSProxyPermissions "IMPORT_MARC"
404         PerlHandler OpenILS::WWW::Proxy
405         Options +ExecCGI
406         PerlSendHeader On
407         allow from all
408 </LocationMatch>
409 <Location /vandelay-upload>
410     SetHandler perl-script
411     PerlHandler OpenILS::WWW::Vandelay::spool_marc
412     Options +ExecCGI
413     allow from all
414 </Location>
415
416 # OpenURL 0.1 searching based on OpenSearch
417 RewriteEngine on
418 RewriteMap openurl prg:/openils/bin/openurl_map.pl
419 RewriteCond %{QUERY_STRING} (^.*$)
420 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
421
422
423
424 # General Evergreen web template processor
425 <Location /eg>
426     SetHandler perl-script
427     PerlHandler OpenILS::WWW::EGWeb
428     Options +ExecCGI
429     PerlSendHeader On
430     allow from all
431 </Location>
432 # Note: the template processor will decline handling anything it does not
433 # have an explicit configuration for, which means it will fall back to 
434 # Apache to serve the file.  However, in the interest of speed, go ahead 
435 # and tell Apache to avoid asking OpenILS::WWW::EGWeb for static content.
436 # Add more exemptions as needed.
437 <LocationMatch ^/eg/.*(\.js|\.css|\.html|\.xhtml|\.xml|\.jpg|\.png|\.gif)$>
438     SetHandler None
439 </LocationMatch>
440
441