How to build gitlab on centos6

How to build gitlab on centos6

Preface

The original project was placed on the public network gitlab. For security reasons, a set was built on the intranet with a graphical interface. It can be directly imported from the external network git. I found it very convenient to use it. I recorded the installation process. Please refer to the official website: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/install/centos You can directly move there to see

Basic environment installation (git\redis\ruby\mysql...)

yum -y groupinstall 'Development Tools'
yum -y install readline readline-devel ncurses-devel gdbm-devel glibc-devel tcl-devel openssl-devel curl-devel expat-devel db4-devel byacc sqlite-devel libyaml libyaml-devel libffi libffi-devel libxml2 libxml2-devel libxslt libxslt-devel libicu libicu-devel system-config-firewall-tui redis sudo wget crontabs logwatch logrotate perl-Time-HiRes git cmake libcom_err-devel.i686 libcom_err-devel.x86_64 nodejs

yum -y install python-docutils
yum -y install postfix
git --version #Install a git version higher than 2.7.4 yum -y remove git
yum install zlib-devel perl-CPAN gettext curl-devel expat-devel gettext-devel openssl-devel
mkdir /tmp/git && cd /tmp/git
curl --progress https://www.kernel.org/pub/software/scm/git/git-2.9.0.tar.gz | tar xz
cd git-2.9.0
./configure
make
make prefix=/usr/local install

yum remove ruby ​​#Install a ruby ​​version higher than 2.1, delete the old one mkdir /tmp/ruby && cd /tmp/ruby
curl --progress https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.9.tar.gz | tar xz
cd ruby-2.1.9
./configure --disable-install-rdoc
make
make prefix=/usr/local install
gem install bundler --no-doc
yum install redis mysql
/Data/apps/mysql/bin/mysqld_safe &
/Data/apps/mysql/bin/mysql -uroot
mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
mysql> grant all on gitlabhq_production.* to 'git'@'localhost' identified by 'git';

Configure redis

vim /etc/redis.conf

unixsocket /var/run/redis/redis.sock
unixsocketperm 0770
mkdir -p /var/run/redis
chown redis:redis /var/run/redis
chmod 755 /var/run/redis
/etc/init.d/redis start
usermod -aG redis git

Configure gitlab related

# Download git, using domestic sources. Foreign is too slow cd /home/git
sudo -u git -H git clone http://git.oschina.net/qiai365/gitlab-ce gitlab
cd /home/git/gitlab
sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml
sudo -u git -H editor config/gitlab.yml
# Change to your own host host: iaasgit1.prod.bj1
sudo -u git -H cp config/secrets.yml.example config/secrets.yml
sudo -u git -H chmod 0600 config/secrets.yml
sudo chown -R git log/
sudo chown -R git tmp/
sudo chmod -R u+rwX,go-w log/
sudo chmod -R u+rwX tmp/
sudo chmod -R u+rwX tmp/pids/
sudo chmod -R u+rwX tmp/sockets/
sudo -u git -H mkdir public/uploads/
sudo chmod 0700 public/uploads
sudo chmod ug+rwX,o-rwx /home/git/repositories/
sudo chmod -R u+rwX builds/
sudo chmod -R u+rwX shared/artifacts/
sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb
nproc
sudo -u git -H editor config/unicorn.rb
sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb
sudo -u git -H git config --global core.autocrlf input
sudo -u git -H git config --global gc.auto 0
sudo -u git -H cp config/resque.yml.example config/resque.yml
sudo -u git -H editor config/resque.yml

Configure the db part only for mysql

sudo -u git cp config/database.yml.mysql config/database.yml
sudo -u git -H editor config/database.yml #Configure the password for the production part: "password"
sudo -u git -H chmod o-rwx config/database.yml

Install gitlab related and start

# install gems
cd /home/git/gitlab
sudo -u git -H bundle install --deployment --without development test postgres aws kerberos

# install gitlab shell
sudo -u git -H bundle exec rake gitlab:shell:install[v3.3.3] REDIS_URL=unix:/var/run/redis/redis.sock RAILS_ENV=production
sudo -u git -H editor /home/git/gitlab-shell/config.yml

# install gitlab-workhorse
cd /home/git
sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-workhorse.git
cd gitlab-workhorse
sudo -u git -H git checkout v0.7.5
sudo -u git -H make

# Initialize Database and Activate Advanced Features
cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production

sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production GITLAB_ROOT_PASSWORD=yourpassword GITLAB_ROOT_EMAIL=youremail
cp lib/support/init.d/gitlab /etc/init.d/gitlab
cp lib/support/init.d/gitlab.default.example /etc/default/gitlab
chkconfig gitlab on
cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
service gitlab start

Configure nginx

yum install nginx
cp lib/support/nginx/gitlab /Data/apps/nginx/conf/include/gitlab.conf
usermod -a -G git nginx
chmod g+rx /home/git/
/Data/apps/nginx/conf/include/gitlab.conf #Configure the server_name in this configuration

Finally check

cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
# Start gitlab
/etc/init.d/gitlab restart

# Open the URL corresponding to server_name directly and find that the styles are gone. Execute sudo -u git -H bundle exec rake assets:clean assets:precompile REDIS_URL=unix:/var/run/redis/redis.sock RAILS_ENV=production

Finally, let me explain

This is just a record of the day-to-day operations. It may involve issues such as permissions. Make sure that nginx\git have permissions to each other. Also, use the check script to check. The prompts are very friendly and can usually be fixed. I wish you success.

The yum used in the middle uses a rewritten packaged rpm, so the path is different from the default. If you use the default, you can change it according to your own situation, or refer to the official website directly. This is a castrated version of the official website based on your own environment.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed tutorial on using Docker to build Gitlab based on CentOS8 system
  • Teach you the detailed process of using Docker to build the Chinese version of gitlab community
  • Two ways to build a private GitLab using Docker
  • Methods and steps for deploying GitLab environment based on Docker
  • Detailed tutorial on building Gitlab server on CentOS8.1
  • Centos7 uses docker to build gitlab server
  • How to build gitlab using Docker example
  • Steps to build your own private GitHub repository with GitLab
  • Detailed explanation of using docker to build gitlab
  • Build a local GitLab server on CentOS7

<<:  Vue implements the requirement of dragging and dropping dynamically generated components

>>:  Installation steps of mysql under linux

Recommend

Implementation code of Nginx anti-hotlink and optimization in Linux

Hide version number The version number is not hid...

How to set mysql to case insensitive

mysql set to case insensitive Windows Go to the d...

MySQL column to row conversion, method of merging fields (must read)

Data Sheet: Column to row: using max(case when th...

Some notes on modifying the innodb_data_file_path parameter of MySQL

Preface innodb_data_file_path is used to specify ...

About MySQL 8.0.13 zip package installation method

MySQL 8.0.13 has a data folder by default. This f...

MySQL permission control details analysis

Table of contents 1. Global level 2. Database lev...

Manually implement js SMS verification code input box

Preface This article records a common SMS verific...

Detailed explanation of mysql replication tool based on python

Table of contents 1. Introduction Second practice...

Example of how to install kong gateway in docker

1. Create a Docker network docker network create ...

How to delete all contents in a directory using Ansible

Students who use Ansible know that Ansible only s...

VMware configuration VMnet8 network method steps

Table of contents 1. Introduction 2. Configuratio...