欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 综合教程 >内容正文

综合教程

GItLib环境搭建

发布时间:2024/6/21 综合教程 36 生活家
生活随笔 收集整理的这篇文章主要介绍了 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.https://help.aliyun.com/document_detail/52857.html

2.https://blog.csdn.net/wangxiuwen12/article/details/118304592

3.https://blog.csdn.net/timonium/article/details/119451755

总结

以上是生活随笔为你收集整理的GItLib环境搭建的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。