CentOS 7 环境搭建GitLab

GitLab是一个基于 Web 的 Git 仓库管理工具,使用开源许可证。

官网:https://about.gitlab.com/

系统要求:

支持的发行版:UbuntuDebianCentOSopenSUSERed Hat Enterprise Linux(请使用CentOS的包),Scientific Linux(请使用CentOS的包),Oracle Linux(请使用CentOS的包)。

ruby 2.3+

mysqlPostgreSQL

git

Redis


CentOS 7环境下的搭建:

官网安装文档:https://about.gitlab.com/installation

1.安装并设置HTTP和SSH防火墙权限:

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

sudo systemctl enable sshd

sudo systemctl start sshd

sudo firewall-cmd --permanent --add-service=http

sudo systemctl reload firewalld


2.安装邮件服务器PostFix(可跳过,用SMTP服务器替代)

sudo yum install postfix

sudo systemctl enable postfix

sudo systemctl start postfix


3.获取安装脚本,自行安装所有依赖包

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

4.安装GitLab

sudo EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ee

EXTERNAL_URL为GitLab打开页面,最好设置成你的“服务器ip/gitlab”,如果此处不设置,后面需要修改ip地址

耐心等待,gitlab-ee包大约400+MB,安装需要空间2G+.


其他配置问题:

修改Gitlab Ip地址:

sudo gitlab-ctl stop unicorn

sudo gitlab-ctl stop sidekiq

vi /etc/gitlab/gitlab.rb

把配置文件中的external_url "http://gitlab.example.com"改为

external_url "http://服务器ip/gitlab"


其他更多配置都在这个文件里面,具体怎么配置见官网。

配置文件生效,这个过程需要一点时间:

sudo gitlab-ctl reconfigure

重启GitLab:

sudo gitlab-ctl restart

重启完成后在浏览器中输入:

服务器ip/gitlab


即可进入Gitlab首页,第一次进入会设置密码。搭建完成。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值