Centos7.9安装gitlab

  1. 安装依赖软件
    yum -y install policycoreutils openssh-server openssh-clients postfix policycoreutils-python
    2.设置postfix开机自启,并启动,postfix支持gitlab发信功能
    systemctl enable postfix && systemctl start postfix
    3.下载gitlab安装包,然后安装
    centos 6系统的下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6
    centos 7系统的下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7

安装命令

rpm  -ivh  gitlab-ce-12.9.9-ce.0.el7.x86_64.rpm

4.修改gitlab配置文件指定服务器ip和自定义端口
vim /etc/gitlab/gitlab.rb
在这里插入图片描述
退出并保存

ps:注意这里设置的端口不能被占用,默认是8080端口,如果8080已经使用,请自定义其它端口,并在防火墙设置开放相对应得端口。

5.重置并启动GitLab

执行以下命令

gitlab-ctl reconfigure

gitlab-ctl restart

提示“ok: run:”表示启动成功。

A.查询参数配置

gitlab-rails console -e production

在这里插入图片描述

B.查询用户账号信息并赋值给u,

irb(main):001:0> u=User.where(id:1).first

在这里插入图片描述

C.设置该用户名的密码,密码这里不要使用引号,不然会无法登录成功,密码9位且没有特殊符号,如

irb(main):002:0> u.password=1234567890

在这里插入图片描述
D.保存信息irb(main):003:0> u.save!
在这里插入图片描述
E.退出irb(main):005:0> exit
在这里插入图片描述

6.访问 GitLab页面

如果没有域名,直接输入服务器ip和指定端口进行访问,初始账户: root 密码: 1234567890

第一次登录修改密码

在这里插入图片描述
7.测试是否可以邮件通知:

登录并添加一个用户,我这里使用qq邮箱添加一个用户

在这里插入图片描述

参考文档:
centos7安装部署gitlab服务器
基于centos7安装gitlab服务器
CentOS7.9安装GitLab(离线)

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CentOS 7.9搭建GitLab服务器的步骤如下: 1. 更新系统:首先,使用命令“sudo yum update”来更新系统软件包。 2. 安装必要的依赖:执行以下命令安装Git和其他必要的依赖项: ``` sudo yum install curl policycoreutils openssh-server openssh-clients perl sudo systemctl enable sshd sudo systemctl start sshd sudo firewall-cmd --permanent --add-service=http sudo systemctl reload firewalld ``` 3. 添加GitLab软件源:使用以下命令添加GitLab的官方软件源: ``` curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash ``` 4. 安装GitLab:运行以下命令安装GitLab Community Edition(CE)或Enterprise Edition(EE): - 安装GitLab CE: ``` sudo EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ce ``` - 安装GitLab EE(需要许可证): ``` sudo EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ee ``` 这里将`http://gitlab.example.com`替换为您的服务器的公共IP地址或域名。 5. 配置GitLab:编辑GitLab配置文件`/etc/gitlab/gitlab.rb`,根据需要设置外部URL和其他配置参数。例如,要使用HTTPS,可以取消注释并设置相应的证书和密钥路径。 6. 重新配置GitLab:运行以下命令重新配置GitLab: ``` sudo gitlab-ctl reconfigure ``` 7. 启动GitLab:执行以下命令启动GitLab: ``` sudo gitlab-ctl start ``` 8. 访问GitLab:使用浏览器访问服务器的公共IP地址或域名,在地址栏中输入之前设置的外部URL。 通过完成上述步骤,您应该能够在CentOS 7.9上成功搭建GitLab服务器。根据需要,您还可以配置其他功能,如用户管理、项目管理、权限设置等。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值