Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Functional Apache2 route for Gitlab 5.0

For your Ruby, you'll must install this gems:

sudo gem install passenger

sudo passenger-install-apache2-module

At this moment, you'll asked to install some Apache2's deps (three deps):

sudo apt-get install apache2-prefork-dev

sudo apt-get install libapr1-dev

sudo apt-get install libaprutil1-dev

Enable these apache modules.

sudo a2enmod proxy

sudo a2enmod proxy_balancer

sudo a2enmod proxy_http

sudo a2enmod rewrite


At my install, I was needed install at port 8081 to don't conflict with my Apache Tomcat at port 8080, to change default Gitlab port I'm just edit /home/git/gitlab/config/gitlab.yml the port parameter.

The gist bellow gitlab.conf has been located at:


And you can active this conf file with:

sudo a2ensite gitlab

You don't need create any symbolic link for public Apache2 folder.

LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/ext/apache2/
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19
PassengerRuby /usr/local/bin/ruby
<VirtualHost *:80>
ServerName localhost
# Point this to your public folder of teambox
DocumentRoot /home/git/gitlab/public
ProxyPass /gitlab/ http://localhost:8081/
ProxyPassReverse /gitlab/ http://localhost:8081/
<Proxy *>
Order deny,allow
Allow from all
# Custom log file locations
ErrorLog /var/log/apache2/gitlab_error.log
CustomLog /var/log/apache2/gitlab_access.log combined

This comment has been minimized.

Copy link

commented May 27, 2013

Will this work with Gitlab 5.2?


This comment has been minimized.

Copy link

commented May 28, 2013

I had to edit a config in puma.rb

bind 'tcp://'

is what I did and then my apache vhost looks like this

<VirtualHost *:80>

ProxyPass /
ProxyPassReverse /
ProxyPreserveHost On

CustomLog /var/log/apache2/gitlab/access.log combined
ErrorLog  /var/log/apache2/gitlab/error.log

Which works well for me, but I needed all of the dependencies.


This comment has been minimized.

Copy link

commented Jun 4, 2013

@carlosjrcabello What operating system you are using? I can't do work my gitlab with this configuration. Do you do something in unicorn.rb? Thanks in advance!


This comment has been minimized.

Copy link

commented Jan 16, 2014

Please note, that first three lines of gitlab.conf file may differ on your system. This three lines must be provided in the final steps of sudo passenger-install-apache2-module execution. So just copy it from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.