Invoke new mod_perl output-filter SetACAO instead of configuring the
[mkws-moved-to-github.git] / etc / apache2 / spclient-live
1 # Configuration for the apache web server
2 # Running on caliban
3
4
5 <VirtualHost *:80>
6     ServerName somesite.indexdata.com
7     DocumentRoot /home/indexdata/mkws/experiments/spclient/
8     ErrorLog /var/log/apache2/somesite-error.log
9     CustomLog /var/log/apache2/somesite-access.log combined
10 </VirtualHost>
11
12
13 <VirtualHost *:80>
14     ServerName mkws.indexdata.com
15
16     ErrorLog /var/log/apache2/mkws-error.log
17     CustomLog /var/log/apache2/mkws-access.log combined
18
19     DocumentRoot /home/indexdata/mkws/experiments/spclient/
20     Alias /libjs-pz2/ /home/indexdata/libjs-pz2/
21     Alias /index.html /home/indexdata/mkws/experiments/spclient/index-mkws.html
22
23     RewriteEngine on
24     RewriteLogLevel 1
25     RewriteLog /var/log/apache2/mkws-rewrite.log 
26     RewriteRule /service-proxy-auth /service-proxy/?command=auth&action=login&username=demo&password=demo [P] # [NE,P]
27
28 # We want *, but can't use credentials unless we specify a particular origin
29 # Instead, we generate the header using mod_perl: see below.
30 #    Header set Access-Control-Allow-Origin "http://somesite.indexdata.com"
31 #    Header set Access-Control-Allow-Origin "*"
32     Header set Access-Control-Allow-Credentials true
33
34     # For MKC Service Proxy
35     ProxyPass        /service-proxy/ http://mk2-test.indexdata.com/service-proxy/
36     ProxyPassReverse /service-proxy/ http://mk2-test.indexdata.com/service-proxy/
37
38     # Although what follows works perfectly well, it's no use to us:
39     # IE8/9 are unable to set or read ANY headers when operating in
40     # CORS mode.
41     #
42     #    PerlOptions +Parent
43     #    PerlSwitches -I/home/indexdata/mkws/etc/mod_perl
44     #    <Location /service-proxy/>
45     #        PerlInputFilterHandler MyApache2::CopyCookie
46     #        PerlOutputFilterHandler MyApache2::CopyCookie
47     #    </Location>
48
49     PerlOptions +Parent
50     PerlSwitches -I/home/indexdata/mkws/etc/mod_perl
51     <Location /service-proxy/>
52         PerlOutputFilterHandler MyApache2::SetACAO
53     </Location>
54 </VirtualHost>