Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

5.0 Install tests

mattias-ohlsson edited this page Apr 14, 2013 · 15 revisions

CentOS 6.4 x86_64 minimal install

packages: git packages-epel: yum install http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

Variables: GL_HOSTNAME=$HOSTNAME RUBY_VERSION="1.9.3-p392" MYSQL_ROOT_PW=$(cat /dev/urandom | tr -cd [:alnum:] | head -c ${1:-16}) GL_GIT_BRANCH="5-0-stable"

Ruby

packages (from rvm install message):

patch gcc-c++ readline-devel zlib-devel libffi-devel openssl-devel make autoconf automake libtool bison libxml2-devel libxslt-devel

packages-epel (from rvm install message): libyaml-devel

Instructions from https://rvm.io

curl -L get.rvm.io | bash -s stable

Load RVM

source /etc/profile.d/rvm.sh

Fix for missing psych

*It seems your ruby installation is missing psych (for YAML output).

*To eliminate this warning, please install libyaml and reinstall your ruby.

Run rvm pkg and add --with-libyaml-dir

rvm pkg install libyaml

Install Ruby (use command to force non-interactive mode)

command rvm install $RUBY_VERSION --with-libyaml-dir=/usr/local/rvm/usr rvm use $RUBY_VERSION

Install core gems

gem install bundler

Users

Create a git user for Gitlab

adduser --system --create-home --comment 'GitLab' git

GitLab shell

Clone gitlab-shell

su - git -c "git clone https://github.com/gitlabhq/gitlab-shell.git"

Edit configuration

su - git -c "cp gitlab-shell/config.yml.example gitlab-shell/config.yml" TODO: edit

Run setup

su - git -c "rvm use 1.9.3-p392;gitlab-shell/bin/install"

Database

Install redis

yum -y install redis

Start redis

service redis start

Automatically start redis

chkconfig redis on

Install mysql-server

yum install -y mysql-server

Turn on autostart

chkconfig mysqld on

Start mysqld

service mysqld start

Create the database

echo "CREATE DATABASE IF NOT EXISTS gitlabhq_production DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';" | mysql -u root

Set MySQL root password in MySQL

echo "UPDATE mysql.user SET Password=PASSWORD('$MYSQL_ROOT_PW') WHERE User='root'; FLUSH PRIVILEGES;" | mysql -u root

TODO: GitLab-user

GitLab

Clone GitLab

su - git -c "git clone https://github.com/gitlabhq/gitlabhq.git gitlab"

Checkout

su - git -c "cd gitlab;git checkout $GL_GIT_BRANCH"

Configure GitLab

cd /home/git/gitlab

Copy the example GitLab config

su git -c "cp config/gitlab.yml.example config/gitlab.yml"

Change gitlabhq hostname to GL_HOSTNAME

sed -i "s/ host: localhost/ host: $GL_HOSTNAME/g" config/gitlab.yml

Change the from email address

sed -i "s/from: gitlab@localhost/from: gitlab@$GL_HOSTNAME/g" config/gitlab.yml TODO: Add variables for email_from and support_email

Create directory for satellites

#su git -c "mkdir /home/git/gitlab-satellites"

Create directory for pids and make sure GitLab can write to it

#sudo -u git -H mkdir tmp/pids/ #sudo chmod -R u+rwX tmp/pids/

Copy the example Unicorn config

su git -c "cp config/unicorn.rb.example config/unicorn.rb" TODO: Listen on localhost:3000

Copy database congiguration

su git -c "cp config/database.yml.mysql config/database.yml"

Set MySQL root password in configuration file

sed -i "s/secure password/$MYSQL_ROOT_PW/g" config/database.yml

Install Gems

Install Charlock holmes

yum -y install libicu-devel gem install charlock_holmes --version '0.6.9'

For MySQL

yum -y install mysql-devel su git -c "bundle install --deployment --without development test postgres"

Initialise Database and Activate Advanced Features

su git -c "bundle exec rake gitlab:setup RAILS_ENV=production" DOIT: Stop: Do you want to continue (yes/no)? yes

Install init script

curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/master/init.d/gitlab-centos chmod +x /etc/init.d/gitlab chkconfig gitlab on

Fix: bundle not in path (edit init-script)

:source /etc/profile.d/rvm.sh :rvm use 1.9.3-p392 service gitlab start

Apache

Install

yum -y install httpd chkconfig httpd on

Configure

setsebool -P httpd_can_network_connect 1 /etc/httpd/conf.d/gitlab.conf

ProxyPass / http://127.0.0.1:8080/ ProxyPassReverse / http://127.0.0.1:8080/ ProxyPreserveHost On

Start

service httpd start

Clone this wiki locally