GItLib环境搭建

服务器配置

centos7+

2核4G+

手动部署GitLab环境

1.安装依赖包

sudo yum install -y curl policycoreutils-python openssh-server

2.依次运行以下命令,配置SSH服务

  • 启动SSH服务

sudo systemctl start sshd

  • 设置SSH服务为开机自启动

sudo systemctl enable sshd

3.安装Postfix来发送通知邮件

sudo yum install postfix

4.设置Postfix开机自启动

sudo systemctl enable postfix

5.启动Postfix服务

  • 运行以下命令,打开main.cf文件

vim /etc/postfix/main.cf

  • 找到如下图所示的代码,然后按i进入编辑模式

inet_interfaces = localhost

  • 将该行代码修改为inet_interfaces = all
  • 按Esc退出编辑模式,然后输入:wq并回车,保存关闭文件
  • 运行以下命令,启动Postfix服务

sudo systemctl start postfix

6.添加GitLab软件包仓库

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

7.安装GitLab

sudo EXTERNAL_URL="GitLab服务器的公网IP地址" yum install -y gitlab-ce

8.构建命令

sudo gitlab-ctl reconfigure

9.检查是否安装成功

sudo gitlab-ctl status

10.启动gitlab服务

sudo gitlab-ctl start

11.获取Linux初装gitlab初始默认密码

cat /etc/gitlab/initial_root_password

12.用浏览器访问GitLab服务器的公网IP地址

常用命令

#更新配置,并启动gitlab服务

sudo gitlab-ctl reconfigure

#启动 gitlab

sudo gitlab-ctl start

#重新GitLab

sudo gitlab-ctl restart

#停止 gitlab

sudo gitlab-ctl stop

#查看gitlab服务状态

sudo gitlab-ctl status

#查看Gitlab日志

sudo gitlab-ctl tail

#修改默认的配置文件

sudo vim /etc/gitlab/gitlab.rb

参考资料

1.安装和使用GitLab - 云服务器 ECS - 阿里云

2.阿里云搭建gitlab_wangxiuwen12的博客-CSDN博客

3.Linux初装gitlab初始默认密码_SunMy的博客-CSDN博客

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值