User:666threesixes666

Disclaimer
This guide is a rough port from the official guide and various internet references.

Some of the steps have been consolidated and obviously customized to the standard Gentoo environment.

If something is missing, please make a point of updating this article, with special attention to dependencies please.

Prerequisites/Dependencies

 * version 2.7.x
 * version 1.9.x
 * Redis
 * Redis
 * Redis

Prepare the Necessary Users
Gitolite should use the git user, already created when git was installed:

Create a user for Gitlab:

Generate a key for Gitlab:

Copy Gitlab's public key to Gitolite's home directory:

Create a folder for Gitolite's scripts and add the new directory to $PATH environment variable for user git:

Add Ruby to gitlab's $PATH environment variable:

Clone from Gitlab's Fork
For the purposes of this guide, the Gitolite v3.2.0 fork provided by Gitlab will be used:

Make sure you download the newest version and adjust the above command accordingly

Install
Use the installer to create a symlink to the Gitolite executable and then run the installer:

Test the Install
Clone the admin repository so SSH adds localhost to SSH's known_hosts file.

Once cloned successfully, the temporary file can be safely removed:

Configure the Package
Use your favorite editor to change localhost to your FQDN:

Make sure GitLab can write to the log/ and tmp/ directories:

Make a directory for satellites

Gitlab makes use of the Unicorn RoR HTTP server to connect to your main webserver:

''If you choose to use TCP, adjust accordingly later. It is useful for testing with Links''

Edit the Gemfile to install the correct database server dependencies:

MySQL/MariaDB
Create the database and user:

Test connecting to the databases with the new user:

Copy the example database configuration file:


 * Edit the new configuration file and add the database credentials just created:

PostgreSQL
Copy the example database configuration file:

Edit the new configuration file and add the database credentials just created:

Your gitlab must be in postgres group to access and test the database

Reload your shell to activate the postgres group

Configure Git to Accept Gitolite
GitLab needs to be able to commit and push changes to Gitolite. In order to do that Git requires a username and email:

Configure Gitlab Hooks
The Gitlab hook system allows you to hook into other external systems you have setup, such as issue trackers, another production server, an irc bot, etc.

Download and Start the Initscript
Gentoo user andmarios has been kind enough to create an init script:

Nginx
Download the official template and activate it:

Use your favorite text editor to change the relevant portions:

Finish Up
Use your favorite web browser to navigate to the new host you set up

If everything loads properly, the installer has made an admin account for you.

rc-update add git-daemon default rc-update add mysql default rc-update add apache default rc-update add ssh default