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