Report this

What is the reason for this report?

How do I install Gitlab with Debian7 and Apache

Posted on May 16, 2014
maik

By maik

I have installed Debian 7 and Gitlab using this tutorial: https://www.digitalocean.com/community/articles/how-to-set-up-gitlab-as-your-very-own-private-github-clone

Now I want to use it with my Apache, can anyone tell me how to do?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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: <br> <br><pre> <br><VirtualHost :80> <br> ServerName gitlab.example.com <br> ServerSignature Off <br> <br> ProxyPreserveHost On <br> <br> <Location /> <br> Order deny,allow <br> Allow from all <br> <br> ProxyPassReverse http://127.0.0.1:8080 <br> ProxyPassReverse http://gitlab.example.com/ <br> </Location> <br> <br> RewriteEngine on <br> RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f <br> RewriteRule . http://127.0.0.1:8080%{REQUEST_URI} [P,QSA] <br> <br> # needed for downloading attachments <br> DocumentRoot /home/git/gitlab/public <br> <br> #Set up apache error documents, if back end goes down (i.e. 503 error) then a maintenance/deploy page is thrown up. <br> ErrorDocument 404 /404.html <br> ErrorDocument 422 /422.html <br> ErrorDocument 500 /500.html <br> ErrorDocument 503 /deploy.html <br></VirtualHost> <br></pre> <br> <br>Then enable your site: <br> <br><pre> <br>a2ensite gitlab <br>a2enmod proxy_http <br>a2enmod proxy <br>service apache2 restart <br></pre> <br> <br>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 <code> service nginx stop</code> <br> <br>Check out this GitHub repo to see all the details for running GitLab on Apache: <br> <br>https://github.com/gitlabhq/gitlab-recipes/tree/master/web-server/apache <br>

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.