linux gitlab服务器搭建yum,gitlab服务器搭建

1.GitLab基本介绍

GitLab是利用Ruby on Rails一个开源的版本管理系统,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目。

与Github类似,GitLab能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访问,它非常易于浏览提交过的版本并提供一个文件历史库。团队成员可以利用内置的简单聊天程序(Wall)进行交流。

它还提供一个代码片段收集功能可以轻松实现代码复用,便于日后有需要的时候进行查找。

Gitlab官网下载地址:https://packages.gitlab.com/g...

2.GitLab工作流程

bV78bB

3.Gitlab环境部署

3.1 Gitlab前期装备

查看linux版本

[root@Git ~]# cat /etc/redhat-release

CentOS Linux release 7.6.1810 (Core)

设置IP地址10.0.0.105

[root@Git ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33

TYPE="Ethernet"

PROXY_METHOD="none"

BROWSER_ONLY="no"

#BOOTPROTO="static"

#BOOTPROTO="dhcp"

DEFROUTE="yes"

IPV4_FAILURE_FATAL="no"

IPV6INIT="yes"

IPV6_AUTOCONF="yes"

IPV6_DEFROUTE="yes"

IPV6_FAILURE_FATAL="no"

IPV6_ADDR_GEN_MODE="stable-privacy"

NAME="ens33"

DEVICE="ens33"

ONBOOT="yes"

IPADDR=10.0.0.105

NETMASK=255.255.255.0

GATEWAY=10.0.0.2

DNS1=10.0.0.2

ZONE=public

安装Gitlab所需要的依赖包curl policycoreutils-python openssh-server openssh-clients

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

开机启动sshd

[root@Git ~]# systemctl enable sshd

[root@Git ~]# systemctl start sshd

防火墙永久开放http

[root@Git ~]# firewall-cmd --permanent --add-service=http #同firewall-cmd --add-port=80/tcp --permanent

success

[root@Git ~]# systemctl reload firewalld

3.2 安装Gitlab-ce 社区版(yum方式)

[root@Git ~]# curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | bash

[root@Git ~]# yum install -y gitlab-ce.x86_64

[root@Git ~]# rpm -qa gitlab-ce

gitlab-ce-12.1.1-ce.0.el7.x86_64

3.3 更改Gitlab配置文件

修改Gitlab配置文件(搜索unicorn修改端口)

[root@Git ~]# vim /etc/gitlab/gitlab.rb

bVbvJaP

更改url地址(同上一个配置文件)

bVbvJaR

更改Gitlib内置nginx配置文件

vim /var/opt/gitlab/nginx/conf/gitlab-http.conf

bVbvJaZ

加载配置,使gitlab配置生效

[root@Git ~]# gitlab-ctl reconfigure

防火墙设置永久开启8050端口

[root@Git gitlab]# firewall-cmd --add-port=8050/tcp --permanent

success

[root@Git ~]# systemctl reload firewalld

开启gitlab

[root@Git ~]# gitlab-ctl start

设置gitlab开机自启动服务

[root@Git gitlab]# systemctl enable gitlab-runsvdir

[root@Git ~]# systemctl status gitlab-runsvdir

● gitlab-runsvdir.service - GitLab Runit supervision process

Loaded: loaded (/usr/lib/systemd/system/gitlab-runsvdir.service; enabled; vendor preset: disabled)

Active: active (running) since Mon 2019-07-29 12:29:14 CST; 3h 36min ago

Main PID: 8665 (runsvdir)

CGroup: /system.slice/gitlab-runsvdir.service

4.访问 GitLab页面

直接输入服务器ip和指定端口进行访问 (如本机10.0.0.105:8050)

设置密码

bVbvJbm

登入界面

账号:root 密码:xxxxx

bVbvJbp

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值