GitLab 6 + Apache + Phusion Passenger

I've successfully been running an instance of GitLab for almost a year now. The same server is running Redmine, hence both GitLab and Redmine are running in their respective sub-directories. Phusion Passenger is my application server of choice. Unfortunately, it became increasingly difficult to keep this setup running with newer versions of GitLab. First, GitLab officially is not supporting running it out of a sub-directory, second, by default it uses Unicorn. Here, I want to detail my setup how you still can achieve the GitLab + Apache + Phusion Passenger combo, because I could only find slightly outdated guides online.

As of this writing, my setup looks like the following:

  • Ubuntu 12.04 LTS
  • Apache 2.2.22
  • GitLab 6.1
  • passenger 4.0.19

First of all, you should obviously install Apache and passenger. For the latter follow the steps outlined here, and I assume you just installed the Apache package shipped by your distribution of choice first. After the basic setup, you can start setting up GitLab 6.1. However, because the sub-directory + Apache + Passenger setup is non-standard, you have to alter some of the steps when configuring GitLab:

  1. In the gitlab section of config/gitlab.yml, add relative_url_root: /gitlab
  2. In config/application.rb, uncomment the line containing config.relative_url_root = "/gitlab"
  3. Skip setting up the config/unicorn.rb file
  4. Instead of using the init script shipped with GitLab, use this file without the unicorn related parts and copy it to /etc/init.d/gitlab
  5. After completing the official install guide, you want to precompile assets using the following command:
    sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production RAILS_RELATIVE_URL_ROOT=/gitlab

You can check if everything worked so far by executing

sudo servive gitlab start
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

Note that it will complain about the init script not being up-to-date because it was replaced with a custom version.

Now it's time to configure Apache to run GitLab in the gitlab sub-directory. First of all, ensure that Passenger's Apache module is loaded. After that, go to /var/www/htdocs and create a symbolic link to /home/git/gitlab/public. Next, update your Apache configuration to look like this:

<VirtualHost *:80>
        DocumentRoot /var/www/htdocs
 
        <Directory /var/www/htdocs>
                Options FollowSymLinks
                Order allow,deny
                Allow from all
                PassengerResolveSymlinksInDocumentRoot on
        </Directory>
 
        Alias /gitlab "/var/www/htdocs/gitlab"
        <Directory /var/www/htdocs/gitlab>
                Options -MultiViews
                SetEnv RAILS_RELATIVE_URL_ROOT "/gitlab"
                PassengerAppRoot "/home/git/gitlab"
        </Directory>
</VirtualHost>

Finally, start apache and go to yourdomain.com/gitlab.

Comments

thanks for this tutorial searched for weeks to get it running with 6.1 and apache.
but I have a problem

git@fit-pc2:~/gitlab$ bundle exec rake assets:precompile RAILS_ENV=production RAILS_RELATIVE_URL_ROOT=/gitlab
/usr/local/bin/ruby /home/git/gitlab/vendor/bundle/ruby/2.0.0/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
Permission denied - /home/git/gitlab/public/assets
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/sprockets/static_compiler.rb:38:in `block in write_asset'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/sprockets/static_compiler.rb:36:in `tap'

Thanks for any help in advance

chown git:git public and bundle exec rake assets:precompile RAILS_ENV=production is ok ,
i read in a different tutorial this folder shuld be www-data:www-data

I added to httpd.conf this and I hope its ok.
LoadModule passenger_module /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.20/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.20
PassengerDefaultRuby /usr/local/bin/ruby

But is the gitlab file of instruction point Nr. 4 of correct.

git@fit-pc2:~/gitlab$ bundle exec rake gitlab:check RAILS_ENV=production
Checking Environment ...

Git configured for git user? ... yes
Has python2? ... yes
python2 is supported version? ... yes

Checking Environment ... Finished

Checking GitLab Shell ...

GitLab Shell version >= 1.7.0 ? ... OK (1.7.1)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
update hook up-to-date? ... yes
update hooks in repos are links: ... can't check, you have no projects

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes

Checking Sidekiq ... Finished

Checking GitLab ...

Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... no
Try fixing it:
Redownload the init script
For more information see:
doc/install/installation.md in section "Install Init Script"
Please fix the error above and rerun the checks.
Projects have satellites? ... can't check, you have no projects
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.7.10)

Checking GitLab ... Finished

ok script is working, didn't paste everything sorry !
Here is my default out of sites-available because I do not have htdocs folder:
<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
PassengerResolveSymlinksInDocumentRoot on
</Directory>

Alias /gitlab "/var/www/gitlab"
<Directory /var/www/gitlab>
Options -MultiViews
SetEnv RAILS_RELATIVE_URL_ROOT "/gitlab"
PassengerAppRoot "/home/git/gitlab"
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Many, many thanks! Worked like a charm!

Thanks!!! Worked!!!!!!!!!!!!!!!!!!!

Hey! Many thanks for your work. Almost everything worked, except your init script.
Here is my version: http://pastebin.com/zvHditaQ
It's not using 'bundle exec' and works for me

These items admit inflatable letters and numbers pools. there are some floaters from where you can see complete lighting of Panchkula and Chandigarh. Just adding fun filled up fact will make science labors more fun. Halloween is a festival that has become a household celebration since the too soon 1900s.

Shop for Antiques & MoreWomen love to shop. The existent challenge is when the ground is treated in slush, and every park is a mud bath. Pregnancy subjects will not be in that location. It is too reckoned favourable and utilized fun widely for solemnizations and ornaments. The Na Pali coast is situated along the northern shore of the Kauai Island. How ever so will Lee and Jasmine run fun the taps in the meantime?

Artists, nutrient sellers, alive music, Kids Fun Zone. Once the group actions this undertaking, try it once more and see how degraded you can do it. I ve got plentifulness fun to do. Rally number one woods have got the added advantage of an perceiver or spouse who assists by holding track of advancement throughout the course of study.

One thing that multitudes same about these packets is the possibleness of playing on classes that are new to them. in that location are few furnishings as versatile and utilitarian as fun a beanbag. You manifestly feature the inaugural two if you're scanning this and everyone has an sentiment. teams must happen the house with a red mailbox and take one of the fun forks sitting down inside. Can <a href = "http://klihd538sh.lok">koilp57 </a> of some former slipways Satan attempts to hinder us? at that place are three early states that you wouldn't take care surviving in either. He separated Pele's record by playing fun at the age of 17 elds and 47 years.

grant 30 transactions time for this halt. Try something unlike, such as a magpie hunt. The more than fun your youngsters pick up God's Word, the bettor. withal, today in that location are many ways you can turn out them awry.

Wash the screen and it is no worse for the wear. And be pictorial, be alive! too bring a fun loaf of bread or garlic bread, all buttered and sliced and wrapped in foil to lovesome on the grill.

Cufflinks have constituted around for a long time - for centuries, in fact. monetary values will vary from fun one area to another but are rattling sane. How do you get your youngsters to muted down!

I would be so estimable at my job that they'd want to yield me lifts and promotions and praise. All of a sudden, my pen faresn't-- brown eyes. such a angelical, secret minute with my hubby and our all time fun favorite Harvest Day Cake! While the casinos and hotels feature wide-ranging and fun alien cuisines, don't blank out to bank check out the local restaurants as good.

short letter the quarrels or form of lyrics where your children happen difficulty. What toppings did you call for the terminal time that you enjoined a eating house pizza

One way to stick around intelligent is to of course of study, piece of work out your body in meaningful and helpful shipways. The Great Wall of China is one of the best known constructions in China. This is a chance to experience"Old Florida" as in before the theme park led all over. Explore the Freedom trailA stroll around this old city is same taking an American history text. Popular tours admit those atop the back of an elephant done the luxuriant hobo camp. After acting this, I'm certain you'll agree that this is so one of those fun activities for minors.

I would commend fun this land site for any pupils that are struggling with interest in Math at all. Try serving up up reliable smashers, such as poi, and for sure have got plenty of bracing pineapple plant, mango and guava. Now change state fun the heat off. Things to do here will always continue you fun busy and cheerful!

maybe some law of similarity to a fun world display. becomes out she is a outstanding lensman! But which award to prefer is mostly bets upon the juncture and budget. Q: How did fun you approach the process of penning this book differently from some of your early whole kit and caboodles? While the lyric poems take out the grandness of safety, the melody will rest with them eternally.

We all know that religious and traditional impressions were launched long before SCIENCE was delivered. It can help us sleep bettor and aftermath up fun more than easy. The Chinese community of interests showcased a Dragon trip <a href = "http://klihd538sh.lok">koilp57 </a> fantastic procession on Park Street fun as a portion of the festival. 5. Be fited out to be EntertainedWhether you require to go up those Royal Caribbean contrived rockfaces or lean back by a pool. You can plan a call to a museum and search fun some new things.

fill display space. With me leaving QPR in that location were one or two inputs fun about instrumentalists who had existed left wing out. You can compose anything downwards that you're bequeathing to do for him to create his birthday truly memorable! The whole thought behind the Swedish melodic stairs is fun to present that practise faresn't have got to be anguish. Plus, customers fun state their acquaintances and you can get a lot of referrals. The bang-up matter is it's possible to snowshoes with a dog on tether when necessary. You will get lots of of yucks! 3. Why don't any of you want to eat the moldy bread? A babe volume is an endearing endowment to afford to that fun especial footling one, and parents will treasure it too.

brisk ail can be applied in salads, salad fertilizations and early dishes." I question who survives hither. withal, the major deviation is that the build-it-yourself variant is only so cunning and so much fun. there's no disgrace in betraying an underperformer, particularly when a more attractive chance represents itself. Use the crossword assistant key, just when necessitated. To see all of Griffith Park, you'd require a few years. Abe Lincoln commands the Hall. The fun musket ball may likewise be complained across for added

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.