Centos7 installation and deployment of gitlab server

I am using centos 7 64bit here, I have tried centos 6 and it is also possible!

1. Install dependent software

yum -y install policycoreutils openssh-server openssh-clients postfix

2. Set postfix to start and start automatically after booting, postfix supports gitlab sending function

systemctl enable postfix && systemctl start postfix

3. Download the gitlab installation package, then install

Download address of centos 6 system: https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6

Download address of centos 7 system: https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7

Mine is centos7, so I found a gitlab8.0.0 version in https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7. It is recommended to download a relatively new version, I chose here An older version is just an experiment

Download the rpm package and install:

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-8.0.0-ce.0.el7.x86_64.rpm

rpm -i gitlab-ce-8.0.0-ce.0.el7.x86_64.rpm

**4. Modify the gitlab configuration file to specify the server ip and custom port: **

vim  /etc/gitlab/gitlab.rb

Exit and save

ps: Note that the port set here cannot be occupied, the default is port 8080, if 8080 has been used, please customize other ports, and open the corresponding port in the firewall settings

5. Reset and start GitLab

carried out:

gitlab-ctl reconfigure

gitlab-ctl restart

ok: run: gitlab-git-http-server:(pid 3922) 1s
ok: run: logrotate:(pid 3929) 0s
ok: run: nginx:(pid 3936) 1s
ok: run: postgresql:(pid 3941) 0s
ok: run: redis:(pid 3950) 0s
ok: run: sidekiq:(pid 3955) 0s
ok: run: unicorn:(pid 3961) 1s

Prompt "ok: run:" indicates successful startup

6. Visit GitLab page

If there is no domain name, directly enter the server ip and designated port for access

Initial account: root Password: 5iveL!fe

First login to change password

6. To set up the gitlab sending function, you need to pay attention to:

The default postfix used by the sending system, smtp is enabled by default, both of which are enabled, neither of them will work.

I set to close smtp here and open postfix

Close smtp method: vim /etc/gitlab/gitlab.rb

Find #gitlab_rails['smtp_enable'] = true and change to gitlab_rails['smtp_enable'] = false

Execute gitlab-ctl reconfigure after modification

The other is to turn off postfix and set to turn on smtp. For related tutorials, please refer to the official website https://doc.gitlab.cc/omnibus/settings/smtp.html

Test whether it can be notified by email:

Log in and add a user, here I use qq mailbox to add a user

Log in to the qq mailbox, you can receive an email notification (if you can't receive it, please check the spam mailbox or check whether the email is blocked and deleted. If so, please add to the whitelist and delete the user and add the user again to receive it, otherwise please check Mail log and make relevant settings)

Error handling:

  1. Login 502 error

Generally it is a permission problem, the solution: chmod -R 755 /var/log/gitlab

If it still doesn’t work, please check your memory. Installing and using GitLab requires at least 4GB of available memory (RAM + Swap)! Since the operating system and other running applications also use memory, be sure to note that the current server has at least 4GB before installing GitLab Available memory. Less than 4GB of memory will cause various weird problems, and 500 errors often occur during use.

  1. gitlab-ctl reconfigure

Error n itdb: could not obtain information about current user: Permission denied

Error executing action run on resource 'execute[/opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8]'

According to the error message, the user's permission problem is probably locked. Installing gitlab-ce will automatically add four users:

gitlab-www:x:497:498::/var/opt/gitlab/nginx:/bin/false

git:x:496:497::/var/opt/gitlab:/bin/sh

gitlab-redis:x:495:496::/var/opt/gitlab/redis:/bin/nologin

gitlab-psql:x:494:495::/var/opt/gitlab/postgresql:/bin/sh

Both Google and Baidu could not search for a solution. Since the error prompts the permission problem, there will be no problem if you follow this direction to check. Later, after checking the file /etc/passwd permission is 600, after giving 644 permission, the error was successfully resolved. problem

Refer to gitlab Chinese official website https://www.gitlab.cc/downloads/#centos7

Recommended Posts

Centos7 installation and deployment of gitlab server
Centos6.5 installation and deployment of KVM
CentOS7 installation and maintenance of Gitlab
Centos-6.5 installation and deployment of LNMP environment
Centos7 installation and deployment of Airflow detailed
Installation and configuration of rsync server under CentOS 6.5
Centos7 installation and configuration of Jenkins
CentOS NTP server installation and configuration
CentOs7 installation and deployment Zabbix3.4 original
Erlang 20.2 installation and deployment under CentOS 7
Centos8 minimal deployment and installation of OpenStack Ussuri detailed tutorial
ubuntu Docker installation and deployment of Rancher
Installation and use of Mysql under CentOS
Installation and configuration of redis under centos7
Installation and deployment of Nginx in Ubuntu
Zabbix installation and deployment and localization under CentOS
Jenkins installation and deployment tutorial under CentOS 7
CentOS server deployment (YUM)
Graphical installation of CentOS8
CentOS7.6 server deployment VNC
Centos7 installation of PHP and Nginx tutorial detailed
Installation and configuration of CentOS 7 in VMware Workstation
Installation, configuration and uninstallation of GitLab in Ubuntu19.1
MySQL 8.0 installation and deployment under CentOS, super detailed!
MySQL 8.0 installation, deployment and configuration tutorial on CentOS 8
Installation and cracking of confluence6.3 operation records under Centos
Centos mysql installation and configuration
Centos7 installation and configuration prometheus
Installation and cracking of Jira7 operation records under Centos
CentOS 7 installation and configuration PPTP
Deployment of graphite on centos7
CentOS installation and configuration cmake
Centos7.5 installation and configuration MongoDB4.0.4
CentOS 7 installation and configuration PPTP
GitLab installation and basic use
centos7 kvm installation and use
Centos7 silent installation of Oracle11g
CentOS7 postgresql installation and use
CentOS environment installation of Docker
Centos7 elk7.1.1 installation and use
Detailed explanation of Spark installation and configuration tutorial under centOS7
CentOS7 installation and maintenance of nginx from entry to master
Deployment of vulnerability scanning and analysis software Nessus under CentOS
Introduction to CentOS7 installation process of openjdk, tomcat and mysql
Centos7 installation of Dameng database tutorial
CentOS8.1 build Gitlab server detailed tutorial
Centos7 hadoop cluster installation and configuration
CentOS 7.X system installation and optimization
Java-JDK installation and configuration under CentOS
CentOS 7 Tomcat service installation and configuration
001. Installation of enterprise-level CentOS7.6 operating system
CentOS7 install and use SQL Server
CentOS deployment method of flask project
2-Kubernetes entry manual installation and deployment
JumpServer Bastion Host--CentOS 8 Installation and Deployment (4)
Centos7 mysql database installation and configuration
2019-07-09 CentOS7 installation
centos7_1708 installation
Using Elastic Stack on CentOS 8: Deployment and authentication configuration of Elasticsearch/Kibana 7.8
CentOS 7 system installation and configuration graphic tutorial
Ubuntu installation and deployment Redash operation notes (2020.08)