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