Centos 7搭建Gitlab服务器

一,安装并配置必要的依赖关系

1,安装ssh

sudo yum install -y curl policycoreutils-pythonopenssh-server

Git是分布式版本控制系统,这意味着您可以在本地工作,但您也可以将更改共享或“推送”到其他服务器。在将更改推送到GitLab服务器之前,您需要一个用于共享信息的安全通信通道。

SSH协议提供此安全性,并允许您对GitLab远程服务器进行身份验证,而无需每次提供用户名或密码。

2,将ssh服务设置成开机启动

sudo systemctl enable sshd

3,启动ssh服务

sudo systemctl start sshd

4,启动防火墙服务,添加http服务到firewalld,pemmanent表示永久生效,若不加--permanent系统下次启动后就会失效。

service firewalld  start
sudo firewall-cmd --permanent --add-service=http

5,重启防火墙

sudo systemctl reload firewalld

6,安装Postfix以发送通知邮件,启动:

sudo yum install postfix

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

  sudo systemctl enable postfix

  sudo systemctl start postfix

7,下载并安装gitlab

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

安装成功后提示界面如下

8,修改gitlab配置文件指定服务器ip和自定义端口:

vim  /etc/gitlab/gitlab.rb

 

进入编辑器后按“i”键进入编辑状态,ESC键退出编辑状态

退出并保存,命令输入“:wq”

9,执行GitLab启动

gitlab-ctl reconfigure
gitlab-ctl restart

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

,启动防火墙服务

service firewalld  start
posted @ 2019-06-27 14:12  白庆国  阅读(228)  评论(0编辑  收藏  举报