cbfd9b960cbf2df909e294a56127d4f05ec8ed34
[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 # ----------------------------------------------------------------------------------
8 # Point / to the opac
9 # ----------------------------------------------------------------------------------
10 RedirectMatch 301 ^/$ /opac/en-US/skin/default/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 # Configure the OPAC
43 # ----------------------------------------------------------------------------------
44 <LocationMatch /opac/>
45     AddType application/xhtml+xml .xml
46    
47     # - configure mod_xmlent
48     XMLEntStripPI "yes"
49     XMLEntEscapeScript "no"
50     XMLEntStripComments "yes"
51     XMLEntContentType "text/html; charset=utf-8"
52     # forces quirks mode which we want for now
53     XMLEntStripDoctype "yes" 
54
55     # - set up the include handlers
56     Options +Includes
57     AddOutputFilter INCLUDES .xsl
58     AddOutputFilter INCLUDES;XMLENT .xml
59                     
60     # add languages as necessary
61     SetEnvIf Request_URI "/en-US/" locale=en-US
62     SetEnvIf Request_URI "/fr-CA/" locale=fr-CA
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/.*\.xhtml$>
94     Options +Includes
95     XMLEntEscapeScript "no"
96     AddOutputFilter INCLUDES;XMLENT .xhtml
97     allow from all
98
99     # We only support one locale (en-US) for the time being
100     SetEnv locale en-US
101 </LocationMatch>
102
103 <LocationMatch /xul/.*\.xul$>
104     Options +Includes
105     XMLEntContentType "application/vnd.mozilla.xul+xml"
106     AddOutputFilter INCLUDES;XMLENT .xul
107     allow from all
108
109     # We only support one locale (en-US) for the time being
110     SetEnv locale en-US
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 # Reports GUI
244 # ----------------------------------------------------------------------------------
245 <LocationMatch /reports/>
246     Options +Includes
247     AddOutputFilter INCLUDES .xhtml
248 </LocationMatch>
249
250 # ----------------------------------------------------------------------------------
251 # XML-RPC gateway
252 # ----------------------------------------------------------------------------------
253 <Location /xml-rpc>
254     SetHandler perl-script
255     PerlHandler OpenILS::WWW::XMLRPCGateway
256     Options +ExecCGI
257     PerlSendHeader On
258     allow from all
259 </Location>
260
261 # ----------------------------------------------------------------------------------
262 # Conify - next-generation Evergreen administration interface
263 # ----------------------------------------------------------------------------------
264 RewriteEngine on
265 RewriteRule ^/conify/.*/global/(.*)$ /conify/global/$1
266 <Location /conify>
267     XMLEntStripPI "yes"
268     XMLEntEscapeScript "no"
269     XMLEntStripComments "yes"
270     XMLEntContentType "text/html; charset=utf-8"
271     AddOutputFilter INCLUDES .html
272  
273     SetHandler perl-script
274     PerlSetVar OILSProxyTitle "Dojo Admin Login"
275     PerlSetVar OILSProxyDescription "Please log in to administer Evergreen"
276     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
277     PerlHandler OpenILS::WWW::Proxy
278     Options +ExecCGI
279     PerlSendHeader On
280     allow from all
281 </Location>
282
283 # OpenURL 0.1 searching based on OpenSearch
284 RewriteEngine on
285 RewriteMap openurl prg:/openils/bin/openurl_map.pl
286 RewriteCond %{QUERY_STRING} (^.*$)
287 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
288