Posted by: sutrisno | October 30, 2014

GitlabHQ on Ubuntu 14.04

GitlabHQ on Ubuntu 14.04

Screenshot - 10302014 - 09:20:15 PM

langkah-langkahnya
#apt-get update
#apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl git-core openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev
# python –version
Python 2.7.6

mkdir /tmp/ruby && cd /tmp/ruby
wget http://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz
tar zxvf ruby-2.1.2.tar.gz
cd ruby-2.1.2
./configure
make
sudo make install

# ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]

# gem install bundler –no-ri –no-rdoc
Fetching: bundler-1.6.5.gem (100%)
Successfully installed bundler-1.6.5
1 gem installed

#adduser –disabled-login –gecos ‘GitLab’ git

cd /home/git
sudo -u git -H git clone https://github.com/gitlabhq/gitlab-shell.git
cd gitlab-shell
sudo -u git -H git checkout v1.7.0
sudo -u git -H cp config.yml.example config.yml

sudo vi config.yml
# GitLab user. git by default
user: git

# Url to gitlab instance. Used for api calls. Should end with a slash.
#gitlab_url: “http://localhost/”
gitlab_url: “http://server1.example.com”

[….]

# sudo -u git -H ./bin/install
mkdir -p /home/git/repositories: true
mkdir -p /home/git/.ssh: true
chmod 700 /home/git/.ssh: true
touch /home/git/.ssh/authorized_keys: true
chmod 600 /home/git/.ssh/authorized_keys: true
chmod -R ug+rwX,o-rwx /home/git/repositories: true
find /home/git/repositories -type d -print0 | xargs -0 chmod g+s: true

sudo apt-get install mariadb-server mariadb-client libmariadbclient-dev

mysql -u root -p
CREATE DATABASE gitlabdb DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON gitlabdb.* TO ‘gitlabuser’@’localhost’ IDENTIFIED BY ‘gitlabuserpassword’;
flush privileges;
quit

cd /home/git
sudo -u git -H git clone https://github.com/gitlabhq/gitlabhq.git gitlab
cd /home/git/gitlab
sudo -u git -H git checkout 6-0-stable
sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml

sudo -u git -H vi config/gitlab.yml

[…]
## GitLab settings
# gitlab:
# ## Web server settings
# host: localhost
# port: 80
# https: false

gitlab:
## Web server settings
host: server1.example.com
port: 80
https: false
[…]

cd /home/git/gitlab
chown -R git log/
chown -R git tmp/
chmod -R u+rwX log/
chmod -R u+rwX tmp/
sudo -u git -H mkdir /home/git/gitlab-satellites
sudo -u git -H mkdir tmp/pids/
sudo -u git -H mkdir tmp/sockets/
chmod -R u+rwX tmp/pids/
chmod -R u+rwX tmp/sockets/
sudo -u git -H mkdir public/uploads
chmod -R u+rwX public/uploads
sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb
sudo -u git -H git config –global user.name “GitLab”
sudo -u git -H git config –global user.email “gitlab@localhost”
sudo -u git -H git config –global core.autocrlf input
sudo -u git cp config/database.yml.mysql config/database.yml

sudo -u git -H vi config/database.yml

[…]
#production:
# adapter: mysql2
# encoding: utf8
# reconnect: false
# database: gitlabhq_production
# pool: 10
# username: root
# password: “secure password”

production:
adapter: mysql2
encoding: utf8
reconnect: false
database: gitlabdb
pool: 10
username: gitlabuser
password: “gitlabuserpassword”
[…]

sudo -u git -H chmod o-rwx config/database.yml

cd /home/git/gitlab
gem install charlock_holmes –version ‘0.6.9.4’

wget https://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.1.1-omnibus-1_amd64.deb
apt-get install openssh-server
apt-get install postfix # Select ‘Internet Site’,

sudo dpkg -i gitlab_7.1.1-omnibus-1_amd64.deb

vi /etc/gitlab/gitlab.rb

[….]
#external_url ‘http://gitlab.example.com’
external_url ‘http://server1.example.com’

#gitlab-ctl reconfigure

You can browse the login page at http://192.168.0.50/users/sign_on use the credentials as username=root and password=5iveL!fe

source http://www.howtoforge.com/how-to-run-your-own-git-server-with-gitlabhq-on-ubuntu-14.04


Leave a comment

Categories