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
    评论
为了搭建GitLab服务器,您需要按照以下步骤进行操作: 1. 准备服务器: - 获取一台运行Linux操作系统的服务器,推荐使用Ubuntu或CentOS。 - 确保服务器具有足够的资源(处理器、内存、存储空间)来支持您的项目需求。 2. 安装依赖: - 更新服务器上的软件包列表: `sudo apt update`(对于Ubuntu)或 `sudo yum update`(对于CentOS)。 - 安装必要的依赖项: `sudo apt install curl openssh-server ca-certificates postfix`(对于Ubuntu)或 `sudo yum install curl openssh-server postfix`(对于CentOS)。 - 在安装过程中,您需要配置Postfix来设置邮件转发。选择"Internet Site"选项,并将系统邮件名称设置为域名,比如"yourdomain.com"。 3. 安装GitLab: - 添加GitLab软件仓库并安装: ``` curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash sudo EXTERNAL_URL="http://yourdomain.com" apt install gitlab-ee ``` 或者 ``` curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash sudo EXTERNAL_URL="http://yourdomain.com" yum install gitlab-ee ``` 请将"yourdomain.com"替换为您的域名或服务器IP地址。 4. 配置GitLab: - 打开配置文件: `sudo nano /etc/gitlab/gitlab.rb`。 - 根据您的需求,修改配置文件中的参数,如外部URL、SMTP设置、存储设置等。 - 保存并关闭配置文件。 5. 启动GitLab: - 执行命令: `sudo gitlab-ctl reconfigure`。 - 等待一段时间,直到GitLab配置完成。 6. 访问GitLab: - 在浏览器中访问您的服务器IP地址或域名。 - 您将被重定向到GitLab登录页面。 - 创建管理员账户,完成注册。 现在,您已经成功搭建了GitLab服务器,并可以开始管理您的项目了!请注意,这只是一个基本的搭建过程,您可能需要进一步配置和定制以满足您的特定需求。参考GitLab官方文档以获取更多信息和帮助:https://docs.gitlab.com/。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值