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