CentOS7下Gitlab安装

系统环境

CentOS7_64位

内存:2GB+(一定要2G以上,否则无法进入gitlab后台)

官方下载地址:

https://packages.gitlab.com/gitlab/gitlab-ce

清华大学镜像源下载地址:

https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/

一、安装准备

这里搭建实验选择下载目前官方的最新包:

[root@localhost opt]# wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-11.7.5-ce.0.el7.x86_64.rpm/download.rpm

安装依赖包:

[root@localhost opt]# yum install curl openssh-server openssh-clients policycoreutils policycoreutils-python 

确保sshd服务启动:

[root@localhost opt]# systemctl enable sshd 
[root@localhost opt]# systemctl start sshd

安装postfix发送通知邮件(可跳过):

[root@localhost opt]# yum install postfix
[root@localhost opt]# systemctl enable postfix

[root@localhost opt]# systemctl start postfix

配置系统防火墙,开启HTTP:

[root@localhost opt]# firewall-cmd --permanent --add-service=http

[root@localhost opt]# systemctl reload firewalld

二、安装配置Gitlab-ce

[root@localhost opt]# rpm -ivh gitlab-ce-11.7.5-ce.0.el7.x86_64.rpm 

安装成功,gitlab 程序的默认安装路径是 /opt/gitlab,gitlab 的配置文件位置在 /etc/gitlab/gitlab.rb。

修改配置文件内容,配置仓库地址:

[root@localhost opt]# vim /etc/gitlab/gitlab.rb 

......

## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab

external_url 'http://192.168.10.142' 

......

使配置生效:

# gitlab-ctl reconfigure #每次更改配置必须执行

重新启动gitlab服务:

gitlab-ctl restart

浏览器使用 http://192.168.10.142 顺利访问 gitlab,跳转到登录界面,首次登陆需要修改root管理员密码:

修改密码后再次登陆:

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值