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