Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install GitLab client in CentOS system

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to install GitLab client in CentOS system", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's take you to learn "How to install GitLab client in CentOS system"!

Add epel repository

The code is as follows:

cat > /etc/yum.repos.d/epel.repo /etc/yum.repos.d/PUIAS_6_computational.repo create database gitlabhq_production;

mysql> quit;

redis.sock path specification

The code is as follows:

su -

service redis-server stop

mkdir /var/run/redis;chown -R redis.redis /var/run/redis

vi /usr/local/redis/etc/redis.conf

unixsocket /var/run/redis/redis.sock

service redis-server start

ls -l /var/run/redis/redis.sock

GitLab

su - git

wget https://github.com/gitlabhq/gitlabhq/archive/v7.4.5.tar.gz

tar xzvf v7.4.5.tar.gz

mv gitlabhq-7.4.5 gitlab

cd gitlab

cp config/gitlab.yml.example config/gitlab.yml

sed -i 's@localhost@git.jb51.net@g' config/gitlab.yml

chown -R git log/

chown -R git tmp/

chmod -R u+rwX log/

chmod -R u+rwX tmp/

mkdir /home/git/gitlab-satellites

mkdir tmp/pids/

mkdir tmp/sockets/

chmod -R u+rwX tmp/pids/

chmod -R u+rwX tmp/sockets/

mkdir public/uploads

chmod -R u+rwX public/uploads

cp config/unicorn.rb.example config/unicorn.rb

git config --global user.name "GitLab"

git config --global user.email "gitlab@jb51.net"

git config --global core.autocrlf input

cp config/resque.yml.example config/resque.yml

GitLab database configuration

The code is as follows:

cp config/database.yml{.mysql,}

cat config/database.yml

production:

adapter: mysql2

encoding: utf8

collation: utf8_general_ci

reconnect: false

database: gitlabhq_production

pool: 10

username: root

password: "password"

# host: localhost

# socket: /tmp/mysql.sock

chmod o-rwx config/database.yml

Gems installation

The code is as follows:

su -

gem install charlock_holmes --version '0.6.9.4'

exit

cd /home/git/gitlab/

bundle install --deployment --without development test postgres puma aws postgres

GitLab shell installation

The code is as follows:

bundle exec rake gitlab:shell:install[v2.1.0] REDIS_URL=unix:/var/run/redis/redis.sock RAILS_ENV=production

vi /home/git/gitlab-shell/config.yml

Change the correct path, such as redis-cli, to bin: "/usr/local/bin/redis-cli"

The code is as follows:

restorecon -Rv /home/git/.ssh

Initialize database and activate advanced features

The code is as follows:

git init

bundle exec rake gitlab:setup RAILS_ENV=production #yes

login......... root

password...... 5iveL! fe

GitLab initialization script

The code is as follows:

su -

wget -O /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/master/init/sysvinit/centos/gitlab-unicorn

chmod +x /etc/init.d/gitlab

chkconfig --add gitlab

chkconfig gitlab on

exit #switch back to git user

Check application status

The code is as follows:

cd /home/git/gitlab/

bundle exec rake gitlab:env:info RAILS_ENV=production

Compile assets

bundle exec rake assets:precompile RAILS_ENV=production

GitLab Launch

The code is as follows:

su -

service gitlab start

Nginx configuration

usermod -a -G git www

chmod 770 /home/git

mkdir /usr/local/nginx/conf/vhost

cd /usr/local/nginx/conf/vhost

wget -O git.jb51.net.conf https://gitlab.com/gitlab-org/gitlab-ce/raw/master/lib/support/nginx/gitlab-ssl

vi git.jb51.net.conf #Modify the configuration item

root /home/git/gitlab/public;

server_name

access_log

error_log

ssl_certificate gitlab.crt;

ssl_certificate_key gitlab.key;

ps: The certificate generation method is as follows (formal environment recommends generating a public key with a third-party signature so that the browser can recognize it):

The code is as follows:

cd /usr/local/nginx/conf

openssl genrsa -out gitlab.key 2048

openssl req -new -x509 -days 36500 -key gitlab.key -out gitlab.crt -subj "/C=CN/ST=Shanghai/L=Shanghai/O=LinuxEye Ltd./ OU=LinuxEye"

restart nginx

The code is as follows:

service nginx restart

Access: https://git.jb51.net, username/password: root/5iveL! fe

At this point, I believe everyone has a deeper understanding of "how to install GitLab client in CentOS system", so let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report