changed SP host from 'mkc.indexdata.com:9009' to 'sp-mkc.indexdata.com' which points...
[mkws-moved-to-github.git] / tools / apache2 / jasmine-dev.template
1 # Configuration for the apache web server                 -*- apache -*-
2
3 #####################################################################
4 # global apache2 config
5 #
6 User ${APACHE_RUN_USER}
7 Group ${APACHE_RUN_GROUP}
8 PidFile ${APACHE_PID_FILE}
9
10 ServerName localhost
11 ServerRoot ${APACHE_SERVER_ROOT}
12 NameVirtualHost *:${APACHE_PORT}
13 Listen ${APACHE_PORT}
14
15 LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
16
17 Include /etc/apache2/mods-available/alias.load
18 Include /etc/apache2/mods-available/authz*.load
19 Include /etc/apache2/mods-available/proxy*.load
20 Include /etc/apache2/mods-available/rewrite.load
21 Include /etc/apache2/mods-available/headers.load
22 Include /etc/apache2/mods-available/mime.load
23 Include /etc/apache2/mods-available/deflate.load
24
25 Include /etc/apache2/mods-available/alias*.conf
26 Include /etc/apache2/mods-available/authz*.conf
27 Include /etc/apache2/mods-available/proxy*.conf
28 Include /etc/apache2/mods-available/mime.conf
29 Include /etc/apache2/mods-available/deflate.conf
30
31 # pazpar2 / service proxy config
32 <VirtualHost *:${APACHE_PORT}>
33     ServerName localhost
34     ServerAlias mkws-dev a.mkws.indexdata.com a.mkws-dev.indexdata.com mkws-dev.indexdata.com 127.0.0.1
35
36     ServerAdmin webmaster@indexdata.com
37     ErrorLog ${APACHE_LOG_DIR}/mkws-jasmine-error.log
38     CustomLog ${APACHE_LOG_DIR}/mkws-jasmine-access.log combined
39
40     RewriteEngine on
41     RewriteLogLevel 1
42     RewriteLog ${APACHE_LOG_DIR}/mkws-jasmine-rewrite.log 
43
44     DocumentRoot ${MKWS_ROOT}/examples/htdocs
45     Alias /tools/htdocs ${MKWS_ROOT}/tools/htdocs
46     Alias /src ${MKWS_ROOT}/src
47     Alias /test ${MKWS_ROOT}/test
48     Alias /jasmine ${MKWS_ROOT}/examples/jasmine
49
50     # CORS setting
51     Header set Access-Control-Allow-Credentials true
52     Header set Access-Control-Allow-Origin "*"
53
54     # compress text output
55     <Location />
56         AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml
57         SetOutputFilter DEFLATE 
58     </Location> 
59
60     # jasmine test account
61     RewriteRule /service-proxy-testauth  /service-proxy/?command=auth&action=login&username=mkwstest&password=mkwstest [P] # [NE,P]
62
63     # mkws devel account (e.g. memached testing)
64     RewriteRule /service-proxy-auth  /service-proxy/?command=auth&action=login&username=mkwsdev&password=mkwsdev [P] # [NE,P]
65
66     ProxyPass        /service-proxy/ http://sp-mkc.indexdata.com/service-proxy/
67     ProxyPassReverse /service-proxy/ http://sp-mkc.indexdata.com/service-proxy/
68
69     ProxyPass        /pazpar2/         http://localhost:8004/pazpar2/
70     ProxyPassReverse /pazpar2/         http://localhost:8004/pazpar2/
71
72 </VirtualHost>
73