栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

GItLib环境搭建

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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博客

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/323569.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号