Ramy Asselin be4aff60dc Add support for running Zuul on Trusty
Puppet install zuul on Ubuntu 14.04 Trusty fails because Apache/2.4.7
does not have mod_mem_cache. According to [1], we should use
 mod_cache_disk instead.

"These modules have been removed: mod_authn_default, mod_authz_default,
 mod_mem_cache. If you were using mod_mem_cache in 2.2,
 look at mod_cache_disk in 2.4."

Add configuration to cache /status.json using mod_cache_disk.

Allow access to the 'DocumentRoot' path, which is disallowed on 14.04
by default.

[1] http://httpd.apache.org/docs/trunk/upgrading.html

Change-Id: I734b5c45e1e088364328e9fc5ec5932d3bfe32c5
2015-01-05 16:08:45 -08:00

47 lines
1.4 KiB
Plaintext

<VirtualHost <%= scope.lookupvar("::zuul::vhost_name") %>:80>
ServerAdmin <%= scope.lookupvar("::zuul::serveradmin") %>
DocumentRoot /var/lib/zuul/www
<Directory /var/lib/zuul/www>
Allow from all
Satisfy Any
</Directory>
ErrorLog ${APACHE_LOG_DIR}/<%= scope.lookupvar("::zuul::vhost_name") %>-error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/<%= scope.lookupvar("::zuul::vhost_name") %>-access.log combined
RewriteEngine on
RewriteRule ^/status.json$ http://127.0.0.1:8001/status.json [P]
AddOutputFilterByType DEFLATE application/json
SetEnv GIT_PROJECT_ROOT /var/lib/zuul/git/
SetEnv GIT_HTTP_EXPORT_ALL
AliasMatch ^/p/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /var/lib/zuul/git/$1
AliasMatch ^/p/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /var/lib/zuul/git/$1
ScriptAlias /p/ /usr/lib/git-core/git-http-backend/
<IfModule mod_cache.c>
CacheDefaultExpire 5
<IfModule mod_mem_cache.c>
CacheEnable mem /status.json
# 12MByte total cache size.
MCacheSize 12288
MCacheMaxObjectCount 10
MCacheMinObjectSize 1
# 8MByte max size per cache entry
MCacheMaxObjectSize 8388608
MCacheMaxStreamingBuffer 8388608
</IfModule>
<IfModule mod_cache_disk.c>
CacheEnable disk /status.json
CacheRoot /var/cache/apache2/mod_cache_disk
</IfModule>
</IfModule>
</VirtualHost>