public
Last active

Functional Apache2 route for Gitlab 5.0

  • Download Gist
README.md
Markdown

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

Obs

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:

/etc/apache2/sites-available/gitlab.conf

And you can active this conf file with:

sudo a2ensite gitlab

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

gitlab.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/ext/apache2/mod_passenger.so
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
</Proxy>
# Custom log file locations
ErrorLog /var/log/apache2/gitlab_error.log
CustomLog /var/log/apache2/gitlab_access.log combined
</VirtualHost>

Will this work with Gitlab 5.2?

I had to edit a config in puma.rb

bind 'tcp://127.0.0.1:9292'

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

<VirtualHost *:80>
ServerName git.example.com

ProxyPass / http://127.0.0.1:9292/
ProxyPassReverse / http://127.0.0.1:9292/
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.

@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!

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.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.