Merge branch 'master' of ssh://git.indexdata.com/home/git/private/mkws
[mkws-moved-to-github.git] / tools / apache2 / jasmine-dev.template-2.4
1 # Configuration for the apache web server                 -*- apache -*-
2
3 #####################################################################
4 # global apache 2.4 config
5 #
6 User ${APACHE_RUN_USER}
7 Group ${APACHE_RUN_GROUP}
8 PidFile ${APACHE_PID_FILE}
9 Mutex file:${APACHE_LOG_DIR}
10
11 ServerName localhost
12 ServerRoot ${APACHE_SERVER_ROOT}
13 Listen ${APACHE_PORT}
14
15 Include ${APACHE_MODULES}
16
17 <IfModule log_config_module>
18    LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
19 </IfModule>
20
21 # pazpar2 / service proxy config
22 <VirtualHost *:${APACHE_PORT}>
23     ServerName localhost
24     ServerAlias mkws-dev a.mkws.indexdata.com a.mkws-dev.indexdata.com mkws-dev.indexdata.com 127.0.0.1
25
26     ServerAdmin webmaster@indexdata.com
27     ErrorLog ${APACHE_LOG_DIR}/mkws-jasmine-error.log
28     CustomLog ${APACHE_LOG_DIR}/mkws-jasmine-access.log combined
29     LogLevel info rewrite:debug
30
31     RewriteEngine on
32
33     DocumentRoot ${MKWS_ROOT}/examples/htdocs
34     Alias /tools/htdocs ${MKWS_ROOT}/tools/htdocs
35     Alias /src ${MKWS_ROOT}/src
36     Alias /test ${MKWS_ROOT}/test
37     Alias /jasmine ${MKWS_ROOT}/examples/jasmine
38
39     # CORS setting
40     Header set Access-Control-Allow-Credentials true
41     Header set Access-Control-Allow-Origin "*"
42
43     # compress text output
44     <Location />
45         AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml
46         SetOutputFilter DEFLATE 
47     </Location> 
48
49     # jasmine test account
50     RewriteRule /service-proxy-testauth(/)?(;jsessionid=.+)?  /service-proxy/$2?command=auth&action=login&username=mkwstest&password=mkwstest [P]
51
52     # mkws devel account (e.g. memached testing)
53     RewriteRule /service-proxy-auth(/)?(;jsessionid=.+)?  /service-proxy/$2?command=auth&action=login&username=mkwsdev&password=mkwsdev [P]
54
55     ProxyPass        /service-proxy/ http://sp-mkc.indexdata.com/service-proxy/
56     ProxyPassReverse /service-proxy/ http://sp-mkc.indexdata.com/service-proxy/
57
58     ProxyPass        /pazpar2/         http://localhost:8004/pazpar2/
59     ProxyPassReverse /pazpar2/         http://localhost:8004/pazpar2/
60
61 </VirtualHost>
62