在轻量应用服务器上安装GitLab:代码仓库管理系

| 2019-05-17

摘要
GitLab 是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的Web服务。安装方法是参考GitLab在GitHub上的Wiki页面。这了演示使用Docker进行安装。
 
正文
1.打开轻量应用服务器页面。安装CentOS7.6版本。(如图)

SSH登录轻量应用服务器后,
 
2.安装依赖软件
yum -y install policycoreutils openssh-server openssh-clients postfix

设置postfix开机自启,并启动,postfix支持gitlab发信功能

systemctl enable postfix && systemctl start postfix

清华大学镜像站:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/

yum -y install wget
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
rpm -ivh gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

修改gitlab配置文件指定服务器ip和自定义端口,防火墙策略自行配置

vim  /etc/gitlab/gitlab.rb

修改内容:

external_url 'http://gitlab.example.com'

防火墙开放

firewall-cmd --zone=public --add-port=10001/tcp --permanent

重启防火墙

firewall-cmd --zone=public --add-port=10001/tcp --permanent

查询是否添加成功

firewall-cmd --query-port=10001/tcp

使用gitlab自动配置,并安装数据库,初始化信息,(第一次使用配置时间较长)

gitlab-ctl reconfigure

启动gitlab服务

gitlab-ctl start

停止gitlab服务

gitlab-ctl stop
第一次访问,要求你设置root用户的密码


登录后页面

完结
以上就是在轻量应用服务器安装GitLab的所有内容,欢迎小伙伴们交流讨论。

编辑:航网科技 来源:腾讯云 本文版权归原作者所有 转载请注明出处

在线客服

微信扫一扫咨询客服


全国免费服务热线
0755-36300002

返回顶部