1. Introduction
GitLab is an open source project for a warehouse management system. It is developed by GitLab Inc., a web-based Git warehouse management tool with MIT license, and has wiki and issue tracking functions. Use Git as a code management tool and build a web service on this basis.
Official website: https://about.gitlab.com/
Official documentation: https://docs.gitlab.com/
2. Description of environment and tools
1. Operating system Centos7.4 x64 Minimal 1708
Install 1 virtual machine: 4G memory, 1 core CPU
2. Tools: xshell5
3. VMware version: VMware Workstation Pro15
Three, installation, deployment
1. Install the virtual machine and configure the virtual machine network
(1) Reference for virtual machine installation process: https://blog.csdn.net/llwy1428/article/details/89328381
(2) Virtual machine network configuration process: https://blog.csdn.net/llwy1428/article/details/85058028
2. Install basic tools
[root@controller ~]# yum install -y curl policycoreutils-python openssh-server openssh-clirnts postfixcronie lokkit rpm
3. Close SELINUX permanently (restart to take effect)
https://blog.csdn.net/llwy1428/article/details/100938748
Temporarily close SELINUX
[root@controller ~]# setenforce 0
4. Turn off the firewall (or open the designated port)
关闭防火墙 : systemctl stop firewalld
查看状态 : systemctl status firewalld
开机禁用 : systemctl disable firewalld
Please refer to other firewall operations
https://blog.csdn.net/llwy1428/article/details/99676257
5. Use the lokkit command to set up the firewall and open HTTP and SSH access permissions
[root@controller ~]# systemctl enable sshd
[root@controller ~]# systemctl start sshd
[root@controller ~]# systemctl enable postfix
[root@controller ~]# systemctl start postfix
[root@controller ~]# lokkit -s http -s ssh
6. Create a directory and download the installation package
[root@controller ~]# mkdir /opt/gitlab
[root@controller ~]# cd /opt/gitlab
Download the gitlab-ce-12.6.1-ce.0.el7.x86_64.rpm installation package (can be downloaded manually)
Download link: https://packages.gitlab.com/gitlab/gitlab-ce/
After downloading, put the file gitlab-ce-12.6.1-ce.0.el7.x86_64.rpm under the /opt/gitlab/ directory, and perform step 7.
(You can also execute the installation command on the official website)
reference:
[root@controller gitlab]# curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
7. Perform installation gitlab-ce
[root@controller gitlab]# yum install gitlab-ce-12.6.1-ce.0.el7.x86_64.rpm -y
If the installation fails, as follows:
Manual download
[root@localhost gitlab]# wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-12.9.10-ce.0.el7.x86_64.rpm/download.rpm
8. Modify the configuration file gitlab-ce
[root@controller ~]# vim /etc/gitlab/gitlab.rb
unicorn['port'] is recommended to be modified, otherwise a "502" error will be reported when the service is restarted, causing the system to fail to log in.
(The port does not conflict with the existing service port of the system)
9. Overload configuration information
[root@controller ~]# gitlab-ctl reconfigure
10. Start, stop, and restart services
(1) Stop service
[root@controller ~]# gitlab-ctl stop
(2) Start the service
[root@controller ~]# gitlab-ctl start
(3) Restart the service
[root@controller ~]# gitlab-ctl restart
11. View log
[root@controller ~]# gitlab-ctl tail
12. Browser login, set initial password
Enter the browser address bar: http://192.168.11.61 ( 192.168.11.61 is the IP of my virtual machine)
13, Chinese configuration
14. Possible problems and solutions
(1) Gitlab login 502 error
solution:
a. Modify /etc/gitlab/gitlab.rb
unicorn['port'] = 8888 (do not conflict with other service ports)
Then gitlab-ctl reconfigure restart the configuration, so that the GitLab server can run normally.
b. Official recommendations
sudo gitlab-ctl restart sidekiq
sudo gitlab-ctl hup unicorn
15. GitLab operation (use tutorial)
https://blog.csdn.net/justlpf/article/details/80681853
At this point, Centos7 installation of GitLab CE v12.6.1 is complete!