How do I install Gitlab with Debian7 and Apache

Posted May 16, 2014 20.6k views
I have installed Debian 7 and Gitlab using this tutorial: Now I want to use it with my Apache, can anyone tell me how to do?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer
That tutorial uses Nginx for the web server. There's no need to install Apache, but you can do so if you want. First we need to create a new VirtualHost for GitLab. Let's use the file "/etc/apache2/sites-available/gitlab" In it we'll put:

<VirtualHost *:80>
ServerSignature Off

ProxyPreserveHost On

<Location />
Order deny,allow
Allow from all


RewriteEngine on
RewriteRule .*{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

Then enable your site:

a2ensite gitlab
a2enmod proxy_http
a2enmod proxy
service apache2 restart

You should be all set now. If you had previously followed the steps to install nginx, you will probably want to uninstall it. You'll at least need to stop it with service nginx stop

Check out this GitHub repo to see all the details for running GitLab on Apache: