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