I am using a RackSpace cloud running Fedora 18 to install GitLab are a replacement for GroundWarp’s Gitolite server. Here are some install instructions for getting it running on CentOS6/RHEL6 (the commerical systems based on Fedora.) iconv-devel
Start by doing yum install/groupinstall the following packages and any dependencies they find.
- yum install ruby mysql -server git redis ruby-devel
- yum groupinstall “Development Tools”
- yum install mysql libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-develzlib-devel openssl-devel libyaml-develreadline-devel curl-devel openssl-devel pcre-develmemcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick libicu libicu-devel libffi-devel rubygem-bundler
Start your database servers and configure them to start on boot.
systemctl start redis.service
systemctl enable redis.service
systemctl start mysqld.service
systemctl enable mysqld.service
MySQL Server Setup:
Start by logging into the mysql shell:
mysql -u root
Then we create the database we will need, and create a user who can edit/manage that database.
create database gitlabdb;
grant usage on *.* to gitlabuser@localhost identified by “inventapasswordhere”;
grant all privileges on gitlabdb.* to gitlabuser@localhost;
Service User and SSH Configuration:
Create the user account that the GitLab service will be running under. This will also be used to build some of the necessary dependancies. After creating the user switch to that user’s login.
su -l git
From here forward (unless otherwise specified) make sure you are logged in as the git user. The remaining configuration is done as that user.
The next steps are required for setting up the SSH keys pairs for your user account (git uses SSH in the background for most of its tasks.) Choose the defaults, but make sure to supply a paraphrase (not just a password) when prompted by ssh-keygen.
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
gitlab-shell needs to be installed built/installed for this user. The following steps sets everything up and builds the packages directly from github (which is the easiest way honestly.)
git clone https://github.com/gitlabhq/gitlab-shell.git gitlab-shell/
cp config.yml.example config.yml
Now you are going to want to use a text editor (nano,vim, etc…) to edit the following change to your config.yml file.
Now run the gitlab-shell installer
Download & Configure GitLab:
Next we will setup our gitlab folders, download Gitlab, and begin configuring it to our set-up
git clone https://github.com/gitlabhq/gitlabhq.git gitlab.
git checkout 5-2-stable
chown -R git.git log/ tmp/
chmod -R u+rX log/ tmp/ public/uploads/
cp config/gitlab.yml.example config/gitlab.yml
Next you will need to make changes (again with your text editor) to the newly copied config/gitlab.yml file.
Our next steps involve configuring the GitLab application database interfaces (remember there are two) and creating initial data entries.
cp config/puma.rb.example config/puma.rb
cp config/database.yml.mysql config/database.yml
Now configure your database file (the database.yml file you just copied) using your text editor and change the following settings under the production header. (Comment out all the lines under development and testing):
We need to install a couple Ruby gems and then initialize the database. You do this by running the following commands (note the “without” command tells the bundle to NOT install PostgreSQL gems.):
gem install charlock_holmes –version ‘0.6.9.4’
gem install thor –version ‘0.18.1’
gem install rb-inotify
bundle install –deployment –without development test postgres
bundle exec rake gitlab:setup RAILS_ENV=production
Git Environment Setup:
We need to setup a couple of environmental variables for our local git user. Simply type this:
git config –global user.name “GitLab”
git config –global user.email “email@example.com”