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

How to install Graphviz and get started tutorial under Windows

Download and installConfigure environment variabl...

How to configure path alias for react scaffolding

The react version when writing this article is 16...

MySQL 8.0.22 decompression version installation tutorial (for beginners only)

Table of contents 1. Resource download 2. Unzip t...

What are the rules for context in JavaScript functions?

Table of contents 1. Rule 1: Object.Method() 1.1 ...

How to implement page jump in Vue project

Table of contents 1. Create a vue-cli default pro...

Teach you to implement a simple promise step by step

Table of contents Step 1: Build the framework Ste...

Pure CSS to achieve hover image pop-out pop-up effect example code

Implementation principle The main graphics are co...

Windows Server 2016 Quick Start Guide to Deploy Remote Desktop Services

Now 2016 server supports multi-site https service...

Linux swap partition (detailed explanation)

Table of contents linux 1. What is SWAP 2. What d...

Web design must also first have a comprehensive image positioning of the website

⑴ Content determines form. First enrich the conten...

Centos8.3, docker deployment springboot project actual case analysis

introduction Currently, k8s is very popular, and ...

Solution to MySQL error code 1862 your password has expired

The blogger hasn't used MySQL for a month or ...