1·、安装ssh服务:yum install -y curl policycoreutils-pythonopenssh-server

 

Centos7搭建gitlab_bash

 

 2、启动ssh服务并设置为开机自启:

  systemctl enable sshd

  systemctl start sshd

Centos7搭建gitlab_git_02

 3、添加http服务到firewalld,pemmanent表示永久生效

Centos7搭建gitlab_bash_03

 

 4、安装Postfix以发送通知邮件,安装命令:yum -y install postfix

 

Centos7搭建gitlab_开机自启_04

 

 5、将postfix服务设置成开机自启动:

  systemctl enable postfix

  systemctl start postfix

6、配置gitlab安装源:curl -fsSL https://packages.gitlab.cn/repository/raw/scripts/setup.sh | /bin/bash

7、安装gitlab:sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-jh(https://gitlab.example.com修改为自己的ip地址)

注意:除非您在安装过程中指定了自定义密码,否则将随机生成一个密码并存储在 /etc/gitlab/initial_root_password 文件中(出于安全原因,24 小时后,此文件会被第一次 ​​gitlab-ctl reconfigure​​ 自动删除,因此若使用随机密码登录,建议安装成功初始登录成功之后,立即修改初始密码)。使用此密码和用户名 ​​root​​ 登录。

Centos7搭建gitlab_git_05

 

9、修改url:vi  /etc/gitlab/gitlab.rb

Centos7搭建gitlab_开机自启_06

 

 10、重置并启动gitlab:

  gitlab-ctl reconfigure

  gitlab-ctl restart

Centos7搭建gitlab_git_07

 

 11、通过网页访问

Centos7搭建gitlab_git_08