I have a server on which I want to run GitLab beside other services. After googling around for some time I found out that I need to do some mod_proxy tricks to get Apache2 to forward requests to GitLab. But now when I try to access any URL on the server that is not a GitLab URL under /git, I simply get an error. I can't even access apaches standard index.html page which I clearly should. The server is running under Ubuntu 14.04 LTS. The configuration file for gitlab is:
#This configuration has been tested on GitLab 6.0.0 and GitLab 6.0.1
#Note this config assumes unicorn is listening on default port 8080.
#Module dependencies
# mod_rewrite
# mod_proxy
# mod_proxy_http
<VirtualHost *:80>
ServerName lmmweb
ServerSignature Off
ProxyPreserveHost On
# Ensure that encoded slashes are not decoded but left in their encoded state.
# http://doc.gitlab.com/ce/api/projects.html#get-single-project
AllowEncodedSlashes NoDecode
<Location /git>
# New authorization commands for apache 2.4 and up
# http://httpd.apache.org/docs/2.4/upgrading.html#access
Require all granted
ProxyPassReverse http://127.0.0.1:8080
</Location>
#apache equivalent of nginx try files
# http://serverfault.com/questions/290784/what-is-apaches-equivalent-of-nginxs-try-files
# http://stackoverflow.com/questions/10954516/apache2-proxypass-for-rails-app-gitlab
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}/git/%{REQUEST_FILENAME} !-f
RewriteRule /git/.* http: // 127.0.0.1 :8080%{REQUEST_URI} [P,QSA]
# needed for downloading attachments
DocumentRoot /home/git/gitlab/public
#Set up apache error documents, if back end goes down (i.e. 503 error) then a maintenance/deploy page is thrown up.
ErrorDocument 404 /404.html
ErrorDocument 422 /422.html
ErrorDocument 500 /500.html
ErrorDocument 503 /deploy.html
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded
ErrorLog /var/log/apache2/gitlab/error.log
</VirtualHost>
I'm pretty sure that there must be a failure inside the RewriteRules but can't find it. I have included double spaces inside the RewriteRule for http:// ... as I'm getting some error due to a lack of reputation.
Best regards and thanks for your help.