]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/apache/eg_vhost.conf
f14d3d703f0e4a12e87359b8f08744cb55dca903
[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 # Configure the OPAC
42 # ----------------------------------------------------------------------------------
43 <LocationMatch /opac/>
44     AddType application/xhtml+xml .xml
45    
46     # - configure mod_xmlent
47     XMLEntStripPI "yes"
48     XMLEntEscapeScript "no"
49     XMLEntStripComments "yes"
50     XMLEntContentType "text/html; charset=utf-8"
51     # forces quirks mode which we want for now
52     XMLEntStripDoctype "yes" 
53
54     # - set up the include handlers
55     Options +Includes
56     AddOutputFilter INCLUDES .xsl
57     AddOutputFilter INCLUDES;XMLENT .xml
58                     
59     # add languages as necessary
60     SetEnvIf Request_URI "/en-US/" locale=en-US
61     SetEnvIf Request_URI "/fr-CA/" locale=fr-CA
62     SetEnvIf Request_URI "/hy-AM/" locale=hy-AM
63     SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
64     
65     # This gives you the option to configure a different host to serve OPAC images from
66     # Specify the hostname (withouth protocol) and path to the images.  Protocol will
67     # be determined at runtime
68     #SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=static.example.org/opac/
69     #SetEnvIf Request_URI ".*" OILS_OPAC_CSS_HOST=static.example.org/opac/
70     #SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=static.example.org/opac/
71
72 </LocationMatch>
73
74
75 # ----------------------------------------------------------------------------------
76 # Force SSL on the OPAC's "My Account" page
77 # ----------------------------------------------------------------------------------
78 <LocationMatch .*/myopac.xml>
79     SSLRequireSSL
80 </LocationMatch>
81
82 <LocationMatch /opac/extras/>
83     AddType application/xhtml+xml .xml
84 </LocationMatch>
85
86 RewriteEngine ON
87 RewriteCond %{QUERY_STRING} locale=([^&]*)
88 RewriteRule ^/opac/[^/]+/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
89 <LocationMatch /opac/[^/]+/extras/slimpac/>
90     AddOutputFilter INCLUDES;XMLENT .html
91 </LocationMatch>
92
93 # ----------------------------------------------------------------------------------
94 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
95 # ----------------------------------------------------------------------------------
96 <LocationMatch /xul>
97     SetEnvIfNoCase Accept-Language "en" locale=en-US
98     SetEnvIfNoCase Accept-Language "fr-CA" locale=fr-CA
99     SetEnvIfNoCase Accept-Language "hy-AM" locale=hy-AM
100 </LocationMatch>
101
102 <LocationMatch /xul/.*\.xhtml$>
103     Options +Includes
104     XMLEntEscapeScript "no"
105     XMLEntStripComments "yes"
106     XMLEntStripPI "yes"
107     XMLEntStripDoctype "yes"
108     XMLEntContentType "text/html; charset=utf-8"
109     AddOutputFilter INCLUDES;XMLENT .xhtml
110     allow from all
111 </LocationMatch>
112
113
114 <LocationMatch /xul/.*\.xul$>
115     Options +Includes
116     XMLEntContentType "application/vnd.mozilla.xul+xml"
117     AddOutputFilter INCLUDES;XMLENT .xul
118     allow from all
119 </LocationMatch>
120
121
122 # ----------------------------------------------------------------------------------
123 # Supercat feeds
124 # ----------------------------------------------------------------------------------
125 <Location /opac/extras/oisbn>
126     SetHandler perl-script
127     PerlHandler OpenILS::WWW::SuperCat::oisbn
128     Options +ExecCGI
129     PerlSendHeader On
130     allow from all
131 </Location>
132 <Location /opac/extras/supercat>
133     SetHandler perl-script
134     PerlHandler OpenILS::WWW::SuperCat::supercat
135     Options +ExecCGI
136     PerlSendHeader On
137     allow from all
138 </Location>
139 <Location /opac/extras/unapi>
140     SetHandler perl-script
141     PerlHandler OpenILS::WWW::SuperCat::unapi
142     Options +ExecCGI
143     PerlSendHeader On
144     allow from all
145 </Location>
146 <Location /opac/extras/feed/bookbag>
147     SetHandler perl-script
148     PerlHandler OpenILS::WWW::SuperCat::bookbag_feed
149     Options +ExecCGI
150     PerlSendHeader On
151     allow from all
152 </Location>
153 <Location /opac/extras/opensearch>
154     SetHandler perl-script
155     PerlHandler OpenILS::WWW::SuperCat::opensearch_feed
156     Options +ExecCGI
157     PerlSendHeader On
158     allow from all
159 </Location>
160 <Location /opac/extras/sru>
161     SetHandler perl-script
162     PerlHandler OpenILS::WWW::SuperCat::sru_search
163     Options +ExecCGI
164     PerlSendHeader On
165     allow from all
166 </Location>
167 <Location /opac/extras/feed/freshmeat>
168     SetHandler perl-script
169     PerlHandler OpenILS::WWW::SuperCat::changes_feed
170     Options +ExecCGI
171     PerlSendHeader On
172     allow from all
173 </Location>
174 <Location /opac/extras/browse>
175     SetHandler perl-script
176     PerlHandler OpenILS::WWW::SuperCat::string_browse
177     Options +ExecCGI
178     PerlSendHeader On
179     allow from all
180 </Location>     
181         
182 # ----------------------------------------------------------------------------------
183 # Module for processing staff-client offline scripts lives here
184 # ----------------------------------------------------------------------------------
185 <Directory "/openils/var/cgi-bin/offline">
186     AddHandler cgi-script .pl
187     AllowOverride None
188     Options +ExecCGI
189     allow from all
190 </Directory>
191         
192         
193 # ----------------------------------------------------------------------------------
194 # XXX Note, it's important to explicitly set the JSON encoding style 
195 # (OSRFGatewayLegacyJSON), since the default encoding style will likely change 
196 # with OpenSRF 1.0
197 # ----------------------------------------------------------------------------------
198 # OpenSRF JSON legacy gateway
199 # ----------------------------------------------------------------------------------
200 <Location /gateway>
201     SetHandler osrf_json_gateway_module
202     OSRFGatewayLegacyJSON "true"
203     allow from all
204 </Location>
205 # ----------------------------------------------------------------------------------
206 # New-style OpenSRF JSON gateway
207 # ----------------------------------------------------------------------------------
208 <Location /osrf-gateway-v1>
209     SetHandler osrf_json_gateway_module
210     OSRFGatewayLegacyJSON "false"
211     allow from all
212 </Location>
213
214 # ----------------------------------------------------------------------------------
215 # OpenSRF-over-HTTP translator
216 # (http://open-ils.org/dokuwiki/doku.php?id=opensrf_over_http)
217 # ----------------------------------------------------------------------------------
218 <Location /osrf-http-translator>
219     SetHandler osrf_http_translator_module
220     allow from all
221 </Location>
222
223 # ----------------------------------------------------------------------------------
224 # The exporter lives here
225 # ----------------------------------------------------------------------------------
226 <Location /exporter>
227     SetHandler perl-script
228     PerlSetVar OILSProxyTitle "Exporter Login"
229     PerlSetVar OILSProxyDescription "Please log in to export records"
230     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
231     PerlHandler OpenILS::WWW::Proxy OpenILS::WWW::Exporter
232     Options +ExecCGI
233     allow from all
234 </Location>
235
236 # ----------------------------------------------------------------------------------
237 # Reporting output lives here
238 # ----------------------------------------------------------------------------------
239 <Location /reporter/>
240     SetHandler perl-script
241     PerlSetVar OILSProxyTitle "Report Login"
242     PerlSetVar OILSProxyDescription "Please log in to view this report"
243     PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
244     PerlHandler OpenILS::WWW::Proxy
245     Options +ExecCGI
246     PerlSendHeader On
247     allow from all
248 </Location>
249
250 # ----------------------------------------------------------------------------------
251 # Selfcheck interface
252 # ----------------------------------------------------------------------------------
253 <LocationMatch .*/selfcheck.xml>
254     SetHandler perl-script
255     PerlSetVar OILSProxyTitle "Selfcheck Login"
256     PerlSetVar OILSProxyDescription "Please log in to activate the selfcheck interface"
257     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
258     PerlHandler OpenILS::WWW::Proxy
259     Options +ExecCGI
260     PerlSendHeader On
261     allow from all
262 </LocationMatch>
263
264
265 # ----------------------------------------------------------------------------------
266 # Reports GUI
267 # ----------------------------------------------------------------------------------
268 <LocationMatch /reports/>
269     Options +Includes
270     SetEnvIfNoCase Accept-Language "en" locale=en-US
271     SetEnvIfNoCase Accept-Language "fr-CA" locale=fr-CA
272     SetEnvIfNoCase Accept-Language "hy-AM" locale=hy-AM
273     XMLEntStripDoctype "yes"
274     XMLEntContentType "text/xml; charset=utf-8"
275     AddOutputFilter INCLUDES .xhtml
276     AddOutputFilter INCLUDES;XMLENT .xml
277 </LocationMatch>
278
279 # ----------------------------------------------------------------------------------
280 # XML-RPC gateway
281 # ----------------------------------------------------------------------------------
282 <Location /xml-rpc>
283     SetHandler perl-script
284     PerlHandler OpenILS::WWW::XMLRPCGateway
285     Options +ExecCGI
286     PerlSendHeader On
287     allow from all
288 </Location>
289
290 # ----------------------------------------------------------------------------------
291 # Conify - next-generation Evergreen administration interface
292 # ----------------------------------------------------------------------------------
293 RewriteEngine on
294 RewriteRule ^/conify/.*/global/(.*)$ /conify/global/$1
295 <Location /conify>
296     XMLEntStripPI "yes"
297     XMLEntEscapeScript "no"
298     XMLEntStripComments "yes"
299     XMLEntContentType "text/html; charset=utf-8"
300     AddOutputFilter INCLUDES .html
301  
302     SetHandler perl-script
303     PerlSetVar OILSProxyTitle "Dojo Admin Login"
304     PerlSetVar OILSProxyDescription "Please log in to administer Evergreen"
305     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
306     PerlHandler OpenILS::WWW::Proxy
307     Options +ExecCGI
308     PerlSendHeader On
309     allow from all
310 </Location>
311
312 # ----------------------------------------------------------------------------------
313 # Vandelay importers / exporters (your Web interface to bibliographic travel)
314 # ----------------------------------------------------------------------------------
315 # capture the locale from the URL
316 AliasMatch ^/vandelay/.*/vandelay.xml(.*) /openils/var/web/vandelay/vandelay.xml$1
317 <Location /vandelay>
318     RewriteEngine on
319     SetEnvIf Request_URI "/en-US/" locale=en-US
320     SetEnvIf Request_URI "/fr-CA/" locale=fr-CA
321     XMLEntStripPI "yes"
322     XMLEntEscapeScript "no"
323     XMLEntStripComments "yes"
324     XMLEntContentType "text/html; charset=utf-8"
325     XMLEntStripDoctype "yes"
326     AddOutputFilter INCLUDES;XMLENT .xml
327         SetHandler perl-script
328         PerlSetVar OILSProxyTitle "Vandelay Login"
329         PerlSetVar OILSProxyDescription "Please log in to import MARC records"
330         PerlSetVar OILSProxyPermissions "IMPORT_MARC"
331         PerlHandler OpenILS::WWW::Proxy
332         Options +ExecCGI
333         PerlSendHeader On
334         allow from all
335 </Location>
336 <Location /vandelay-upload>
337     SetHandler perl-script
338     PerlHandler OpenILS::WWW::Vandelay::spool_marc
339     Options +ExecCGI
340     allow from all
341 </Location>
342
343
344
345 # OpenURL 0.1 searching based on OpenSearch
346 RewriteEngine on
347 RewriteMap openurl prg:/openils/bin/openurl_map.pl
348 RewriteCond %{QUERY_STRING} (^.*$)
349 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
350