centos上搭建gitlab

搭建gitLab平台

1.安装gitlab需要的组件:

[root@centos-xidian ~]#yum install curl policycoreutils openssh-server openssh-clients postfix -y
[root@centos-xidian ~]# systemctl enable sshd
bash: systemctl: command not found
[root@centos-xidian ~]# service sshd enable
Usage: /etc/init.d/sshd {start|stop|restart|reload|force-reload|condrestart|try-restart|status}
[root@centos-xidian ~]# service sshd start
[root@centos-xidian ~]# service postfix enable
Usage: /etc/init.d/postfix {start|stop|restart|reload|abort|flush|check|status|condrestart}
[root@centos-xidian ~]# service postfix start
[root@centos-xidian ~]# iptables -F

2 安装gitLab

方法1:使用yum源
[root@centos-xidian yum.repos.d]# vim gitlab_gitlab-ce.repo
[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7 repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key
[root@xuegod63 ~]# yum install gitlab-ce -y
方法2 本地上传
将下载的软件包 gitlab-ce-10.2.3-ce.0.el6.x86_64.rpm 上传到 linux系统中。

配置gitLab域名:
[root@centos-xidian ~]# vim /etc/gitlab/gitlab.rb #修改 gitlab外部访问地址 改:13 external_url ‘http://gitlab.example.com’ 为:13 external_url ‘http://192.168.13.220’

应用重新配好的配置并重启GitLab
[root@centos-xidian ~]# gitlab-ctl reconfigure #重新配置应用程序。修改了gitlab服务配置文 件后,都需要执行一下这个命令。让各个服务的配置文件,重新加载一下配置文件。这里等个 2分钟左史。
出现错误:
在这里插入图片描述
修改
[root@centos-xidianyum.repos.d]# vim gitlab_gitlab-ce.repo [gitlab-ce]
name=gitlab-ce baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key
#上面数字7换成6
#删除原来安装的 重新安装
[root@centos-xidian etc]# rpm -e gitlab-ce
[root@centos-xidian etc]# ps aux | grep gitlab
[root@centos-xidian etc]# kill -9 PID
[root@centos-xidian etc]# find / -name gitlab | xargs rm -rf
清除完毕,重新安装
可以通过下载对应安装包来安装
官方下载地址在 https://packages.gitlab.com/gitlab
可以通过下面的来拉取
#wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-10.6.2-ce.0.el7.x86_64.rpm
[root@centos-xidian ~]# rpm -ivh gitlab-ce-12.3.5-ce.0.el6.x86_64.rpm (包名)

重新配置好重启配置后查看
[root@centos-xidian ~]# gitlab-ctl status
[root@centos-xidian ~]# netstat -antup | grep :80

3 部署汉化版 gitlab 10.2.3

上传对应版本的解压包我这里时10.2.3版本的
[root@localhost ~]# tar zxvf gitlab-patch-zh.tat.gz
[root@localhost ~]# cat /root/gitlab/VERSION #查看该汉化补丁的版本
1、停止 gitlab 服务
[root@localhost ~]# gitlab-ctl stop
2、切换到gitlab汉化包所在的目录(即步骤二获取的汉化版 gitlab)
cd /root/gitlab
3、 比较汉化标签和原标签,导出 patch 用的 diff 文件到/root下 [root@localhost gitlab]# git diff v10.2.3 v10.2.3-zh > …/10.2.3-zh.diff
4、 将10.2.3-zh.diff作为补丁更新到 gitlab中
[root@local gitlab]# patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < /root/10.2.3-zh.diff #这个目录下存储着关亍web前端相关的页面
[root@localhost gitlab]# gitlab-ctl restart #重启服务,等1分钟,再去访问web页面。 访问太快会显示 502错误
至此汉化结束,浏览器登录

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值