在 linux 下搭建 git & gitlab

偶尔善良 提交于 2020-02-07 10:31:43

在 linux 下搭建 git & gitlab, 傻瓜式安装步骤,没有出错

  1. 下载 git 环境
yum install -y git
  1. 创建 git 用户, 管理 git 用户
useradd git

passwd git
  1. 安装 ssh
sudo yum install -y curl policycoreutils-pythonopenssh-server
  1. 将SSH服务设置成开机自启动
sudo systemctl enable sshd
  1. 启动SSH服务
sudo systemctl start sshd
  1. 安装防火墙 (可以忽略)
yum install firewalld systemd -y
  1. 开启防火墙,安装命令
service firewalld  start
  1. 添加http服务到firewalld,pemmanent表示永久生效,若不加–permanent系统下次启动后就会失效
sudo firewall-cmd --permanent --add-service=http
  1. 重启防火墙
sudo systemctl reload firewalld
  1. 安装Postfix以发送通知邮件
sudo yum install postfix
  1. 将postfix服务设置成开机自启动
sudo systemctl enable postfix
  1. 启动postfix
sudo systemctl start postfix
  1. 进行下载 gitlab
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.3.3-ce.0.el7.x86_64.rpm
  1. 进行解压
rpm -i gitlab-ce-11.3.3-ce.0.el7.x86_64.rpm
解压过程可能会出现
rpm -i gitlab-ce-11.0.3-ce.0.el7.x86_64.rpm
如下报错:

警告:gitlab-ce-11.0.3-ce.0.el7.x86_64.rpm:V4 RSA/SHA1 Signature, 密钥 ID f27eab47: NOKEY
错误:依赖检测失败:
policycoreutils-python 被 

gitlab-ce-11.0.3-ce.0.el7.x86_64 需要
[root@izbp191siji73ir3cjd0faz tools]# yum install 

policycoreutils-python


执行: yum install policycoreutils-python

再次安装: rpm -i gitlab-ce-11.0.3-ce.0.el7.x86_64.rpm

在这里插入图片描述
15. 修改gitlab配置文件指定服务器ip和自定义端口

vim  /etc/gitlab/gitlab.rb		//	http:// "ip地址":"端口号"
稍后在浏览器访问这个就可以
  1. 重置并启动 gitlab
gitlab-ctl reconfigure		// 这个过程比较慢

gitlab-ctl restart
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!