]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/apache/eg_vhost.conf
Add some protection against broken cover art
[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 # ----------------------------------------------------------------------------------
208 # The exporter lives here
209 # ----------------------------------------------------------------------------------
210 <Location /exporter>
211     SetHandler perl-script
212     PerlSetVar OILSProxyTitle "Exporter Login"
213     PerlSetVar OILSProxyDescription "Please log in to export records"
214     PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
215     PerlHandler OpenILS::WWW::Proxy OpenILS::WWW::Exporter
216     Options +ExecCGI
217     allow from all
218 </Location>
219
220 # ----------------------------------------------------------------------------------
221 # Reporting output lives here
222 # ----------------------------------------------------------------------------------
223 <Location /reporter/>
224     SetHandler perl-script
225     PerlSetVar OILSProxyTitle "Report Login"
226     PerlSetVar OILSProxyDescription "Please log in to view this report"
227     PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT"
228     PerlHandler OpenILS::WWW::Proxy
229     Options +ExecCGI
230     PerlSendHeader On
231     allow from all
232 </Location>
233
234 # ----------------------------------------------------------------------------------
235 # Reports GUI
236 # ----------------------------------------------------------------------------------
237 <LocationMatch /reports/>
238     Options +Includes
239     AddOutputFilter INCLUDES .xhtml
240 </LocationMatch>
241
242 # ----------------------------------------------------------------------------------
243 # XML-RPC gateway
244 # ----------------------------------------------------------------------------------
245 <Location /xml-rpc>
246     SetHandler perl-script
247     PerlHandler OpenILS::WWW::XMLRPCGateway
248     Options +ExecCGI
249     PerlSendHeader On
250     allow from all
251 </Location>
252