A: gitlab-CentOS installation
1. Environmental ready
. 1 [the root ~ @ 1-231] # CAT / etc / RedHat-Release 2 the CentOS the Linux Release 7.4.1708 (Core) . 3 [the root ~ @ 1-231] # the uname -R & lt . 4 3.10.0-693.5.2 .el7 .x86_64 . 5 . 6 download epel source . 7 [the root ~ @ 1-231] # wget http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm . 8 [the root ~ @ 1-231] # RPM -ivh EPEL-Release-Latest-7.noarch.rpm . 9 [the root ~ @ 1-231] # wget -O /etc/yum.repos.d/CentOS-Base.repo HTTP: //mirrors.aliyun. COM / the repo / Centos 7.repo- 10 . 11 off the firewall and networkmanager 12 [root@1-231 ~]# systemctl stop firewalld.service 13 [root@1-231 ~]# systemctl disable firewalld 14 [root@1-231 ~]# systemctl disable NetworkManager 15 16 关闭selinux并确认处于关闭状态 17 [root@1-231 ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config 18 [root@1-231 ~]# grep SELINUX=disabled /etc/selinux/config 19 SELINUX=disabled 20 [root@1-231 ~]# setenforce 0 21 setenforce: SELinux is disabled 22 23 to update the system and restart 24 [the root @ 1-231 ~] # yum Update -Y && reboot
2. Install gitlab
. 1 [the root @ 1-231 ~] # yum the install the policycoreutils curl OpenSSH OpenSSH-Server-Clients postfix -Y 2 [the root ~ @ 1-231] # systemctl Start postfix . 3 [the root ~ @ 1-231] # curl -sS HTTPS : //packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | the sudo the bash . 4 [the root @ 1-231 ~] # yum the install gitlab -Y-CE . 5 . 6 due to network problems, foreign connection mirror connection timeout, domestic users, Tsinghua mirror source is recommended to install . 7 [the root ~ @ 1-231] # CAT /etc/yum.repos.d/gitlab-ce.repo . 8 [gitlab- CE] . 9 = gitlab- name CE 10 baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7 11 repo_gpgcheck=0 12 gpgcheck=0 13 enabled=1 14 gpgkey=https://packages.gitlab.com/gpg.key 15 [root@1-231 ~]# yum makecache 16 [root@1-231 ~]# yum install -y gitlab-ce
3. Install a git client
1 [root@1-231 ~]# yum install -y git
4. configured and activated gitlab-ce
. 1 [the root ~ @ 1-231] # gitlab the reconfigure CTL- 2 # time may be relatively long, can you wait patiently . 3 . 4 gitlab Common Commands: 5 Close gitlab: [the root ~ @ 1-231] # gitlab-STOP CTL . 6 start gitlab: [the root ~ @ 1-231] # gitlab start-CTL . 7 restart gitlab: [the root ~ @ 1-231] # gitlab the restart-CTL . 8 overload profile: gitlab- CTL the reconfigure . 9 10 may be used gitlab- CTL gitlab management, such as viewing the status gitlab: . 11 [the root ~ @ 1-231] # gitlab CTL-status 12 is RUN: gitaly: (PID 13265) 2545s; RUN: log: (PID 12780 ) 2590s 13 run: gitlab-monitor: (pid 13310) 2544s; run: log: (pid 12989) 2572s 14 run: gitlab-workhorse: (pid 13286) 2544s; run: log: (pid 12851) 2584s 15 run: logrotate: (pid 13155) 2547s; run: log: (pid 12896) 2580s 16 run: nginx: (pid 13198) 2547s; run: log: (pid 12874) 2582s 17 run: node-exporter: (pid 13205) 2546s; run: log: (pid 12967) 2574s 18 run: postgres-exporter: (pid 13367) 2543s; run: log: (pid 13066) 2558s 19 run: postgresql: (pid 13238) 2545s; run: log: (pid 12593) 2633s 20 RUN: Prometheus: (PID 13354) 2543s; RUN: log: (PID 13025 ) 2564s 21 is RUN: Redis: (PID 13274) 2545s; RUN: log: (PID 12533 ) 2639s 22 is RUN: Redis-Exporter: (PID 13293) 2544s; RUN: log: (PID 13008 ) 2566s 23 is RUN: sidekiq: (PID 13386) 2542s; RUN: log: (PID 12760 ) 2596s 24 RUN: Unicorn: (PID 13410) 2541s; RUN: log: (PID 12711 ) 2602s 25 26 NOTE: we must ensure that port 80 is not occupied by 27 , we can look at the port 28 [root @ 1-231 ~] # gitlab-ctl restart 29 the ok: RUN: gitaly: (pid 32816 ) 0s 30 ok: run: gitlab-monitor: (pid 32831) 1s 31 ok: run: gitlab-workhorse: (pid 32841) 0s 32 ok: run: logrotate: (pid 32850) 1s 33 ok: run: nginx: (pid 32892) 0s 34 ok: run: node-exporter: (pid 32898) 0s 35 ok: run: postgres-exporter: (pid 32906) 1s 36 ok: run: postgresql: (pid 32917) 0s 37 ok: run: prometheus: (pid 32926) 1s 38 ok: run: redis: (pid 32934) 0s 39 ok: run: redis-exporter: (pid 32938) 1s 40 ok: run: sidekiq: (pid 32946) 0s 41 ok: run: unicorn: (pid 32955) 0s 42 43 [root@1-231 ~]# lsof -i :80 44 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME 45 nginx 32892 root 7u IPv4 81927 0t0 TCP *:http (LISTEN) 46 nginx 32893 gitlab-www 7u IPv4 81927 0t0 TCP *:http (LISTEN) 47 nginx 32894 gitlab-www 7u IPv4 81927 0t0 TCP *:http (LISTEN)
5. web: browser access test: 192.168.1.231
Tip: Start gitlab takes time!
Web page suggesting we need to set up an account password (we want to set a minimum of 8-digit account password) we set the password is: 12345678
The default user is: root
The password is: 12345678
We set the user name in the back of the page