Monty Taylor c510a30e1e Modified gerrit to use MySQL and Apache modules.
Change-Id: I82ff3c46438f8db126fa6a881efa09c90b1906e4
2012-07-27 17:37:37 +00:00

66 lines
1.8 KiB
Plaintext

<VirtualHost *:80>
ErrorLog ${APACHE_LOG_DIR}/gerrit-error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/gerrit-access.log combined
Redirect / <%= scope.lookupvar("gerrit::canonicalweburl") %>
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerName <%= scope.lookupvar("gerrit::virtual_hostname") %>
ErrorLog ${APACHE_LOG_DIR}/gerrit-ssl-error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/gerrit-ssl-access.log combined
SSLEngine on
SSLCertificateFile <%= scope.lookupvar("gerrit::ssl_cert_file") %>
SSLCertificateKeyFile <%= scope.lookupvar("gerrit::ssl_key_file") %>
<% if scope.lookupvar("gerrit::ssl_chain_file") != "" %>
SSLCertificateChainFile <%= scope.lookupvar("gerrit::ssl_chain_file") %>
<% end %>
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
RewriteEngine on
RewriteCond %{HTTP_HOST} !<%= scope.lookupvar("gerrit::virtual_hostname") %>
RewriteRule ^.*$ <%= scope.lookupvar("gerrit::canonicalweburl") %>
RewriteCond %{REQUEST_URI} !^/p/
RewriteRule ^/(.*)$ http://localhost:8081/$1 [P]
ProxyPassReverse / http://localhost:8081/
SetEnv GIT_PROJECT_ROOT /var/lib/git/
SetEnv GIT_HTTP_EXPORT_ALL
AliasMatch ^/p/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /var/lib/git/$1
AliasMatch ^/p/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /var/lib/git/$1
ScriptAlias /p/ /usr/lib/git-core/git-http-backend/
<Directory /home/gerrit2/review_site/git/>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
</IfModule>