Centos6 method steps to build gitlab

Foreword

The original project is placed on the gitlab of the public network. For safety reasons, a set of internal network is built, with a graphical interface, which can be imported directly from the external network git. It is very convenient to use it. Record the installation process and 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 higher than 2.7.Git version 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 higher than 2.1 version of ruby, 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, use the domestic source. Foreign ones are 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
# Modify 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 0700public/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 in the production section:"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 #Put the server in this configuration_name configured

Last 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 server directly_The url corresponding to name, found that the style is gone, execute
sudo -u git -H bundle exec rake assets:clean assets:precompile REDIS_URL=unix:/var/run/redis/redis.sock RAILS_ENV=production

A final note

This is just a running account, which may involve permissions and other issues. Make sure whether nginx\git have permissions between each other. In addition, use the check script to check, the prompt is very friendly, and generally it can be done. I wish you success.

The yum used in the middle is used to rewrite the packaged rpm, and the path is different from the default. If you use the default, you can change it according to your own situation, or directly refer to the official website. This is one of the official website according to your own environment. Castrated version.

The above is the whole content of this article, I hope it will be helpful to everyone's study.

Recommended Posts

Centos6 method steps to build gitlab
CentOS 6.8 method steps to install vsftpd
Linux (centos7) build gitlab
Centos8 implementation steps to build a local web server
How to upgrade CentOS7 to CentOS8 (detailed steps)
CentOS8.1 build Gitlab server detailed tutorial
Centos7 uses vim to build powerful pyt
ubuntu16.04 method steps to upgrade the kernel
Five minutes to learn centos configuration gitlab
Steps to build LNMP environment on ubuntu 20.04
(1) Centos7 installation to build a cluster environment
Centos8 uses yum to install mongodb 4.2 method
CentOS7 build gerrit code review service method
Centos build lnmp
CentOS 7 install Gitlab
How to quickly build Nginx server under CentOS
Centos7 tutorial to build a master-slave DNS server
Centos7 uses LVM to achieve dynamic expansion method
How to build a LAMP environment on centos7.2
Centos7.2 compile and install way to build phpMyAdmin
CentOS7.3 64 bit, build Zabbix3.4
CentOS build private git
Build k8s1.9.9 on centos7
Centos 6.4 python 2.6 upgrade to 2.7
CentOS6.7 build LNMP environment
Centos 6.4 python 2.6 upgrade to 2.7
CentOS 7 install vsftpd steps
Centos7.6 build LNMP environment
Centos7 build Kubernetes cluster
CentOS uses Nginx to build a download function server
Jenkins build on centos
Detailed steps to install Sogou input method on Ubuntu 20.04
Centos7 build DNS service
CentOS 5 to CentOS 5.8 YUM source
Detailed steps to install centos on vmware10.0 cracked version
Docker CentOS installation method
CentOS 7 build LNMP environment
First try to build a Ceph storage cluster on Centos7
Detailed steps to set up a Git server on CentOS
Detailed steps to install and configure k8s cluster in centos 7
Centos default python2.6 upgrade to
Build docker environment under Centos6.5
CentOS upgrade python2 to pyth
CentOs7.3 build Solr stand-alone service
Build OpenV** Server under CentOS7
CentOs7.3 build RabbitMQ 3.6 stand-alone service
Build zabbix monitoring zabbix4.2 in CentOS7.6
Build OpenLDAP server under CentOS7
Build MariaDB replication on CentOS
CentOs7.3 build ZooKeeper-3.4.9 stand-alone service
CentOs7.3 build SolrCloud cluster service
Ubuntu16.04 build GitLab server tutorial
Update gcc to 6.4.0 in centos
Detailed steps to install virtual machines with VMware 15 and use CentOS 8
Centos8 uses Apache httpd2.4.37 to install web server steps in detail