Gitlub企业级代码仓库

安装的时候有可能会报错,尽量把内存加到2G以上

[root@localhost ~]# echo "git02 127.0.0.1" >> /etc/hosts			#讲本地映射到本地hosts文件中
[root@localhost ~]# tail -1 /etc/hosts
git02 127.0.0.1
[root@localhost ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.2.3-ce.0.el7.x86_64.rpm		从云yum上下载gitlab安装包
[root@localhost ~]# yum localinstall gitlab-ce-11.2.3-ce.0.el7.x86_64.rpm -y		#yum localinstall 利用yum安装本地指定的rpm包,好处是自动解决依赖问题

#初始化GitLab,只需要执行一次
[root@localhost ~]# gitlab-ctl reconfigure
#查看gitlab启动状态
[root@localhost ~]# gitlab-ctl status
#查看gitlab的版本号
[root@localhost ~]# cat /opt/gitlab/embedded/service/gitlab-rails/VERSION 

[root@localhost ~]# gitlab-ctl start		#启动gitlab的服务

在这里插入图片描述

在pc端输入gitlab_server端的ip地址就可以进行登录访问

在这里插入图片描述
设定管理员初始密码,最少8位

在这里插入图片描述

登录成功后的页面,下面有功能就可以使用了
在这里插入图片描述
gitlab中文社区版补丁包安装
GitLab中文社区: https://gitlab.com/xhang/gitlab/tree/11-2-stable-zh

#解压gitlab中文版补丁包
[root@localhost ~]# tar xf gitlab-11-2-stable-zh.tar.gz 
#查看系统安装好的gitlab版本号
[root@localhost ~]# cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
11.2.3
#查看解压后的补丁包版本号
[root@localhost ~]# cat gitlab-11-2-stable-zh/VERSION 
11.2.3
注意:
补丁包版本号和安装的gitlab的版本号需要一致的。

#备份英文版的gitlab
[root@localhost ~]# cp -r /opt/gitlab/embedded/service/gitlab-rails{,.bak}
#将中文补丁包的内容覆盖到英文版
[root@localhost ~]# /bin/cp -rf gitlab-11-2-stable-zh/* /opt/gitlab/embedded/service/gitlab-rails/

/bin/cp: cannot overwrite non-directory ‘/opt/gitlab/embedded/service/gitlab-rails/log’ with directory ‘gitlab-11-2-stable-zh/log’
/bin/cp: cannot overwrite non-directory ‘/opt/gitlab/embedded/service/gitlab-rails/tmp’ with directory ‘gitlab-11-2-stable-zh/tmp’
#注意
此报错不用管,因为已经设置过root密码,登录过,所以会报错

#重新配置gitlab
[root@localhost ~]# gitlab-ctl reconfigure
#重新启动gitlab
[root@localhost ~]# gitlab-ctl restart

重新刷新浏览器访问gitlab
在这里插入图片描述

创建一个项目

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

修改GitLab配置文件/etc/gitlab/gitlab.rb

我们需要修改GitLab的默认访问域名(因为我们是在内网搭建的GitLab)
GitLab默认的监听端口为80,但是在企业中,这个端口经常被别的服务占用,所以我们还需要更换端口号

[root@localhost ~]# cat -n /etc/gitlab/gitlab.rb.bak | sed -n '13p;943p'
cat: /etc/gitlab/gitlab.rb.bak: No such file or directory
[root@localhost ~]# cat -n /etc/gitlab/gitlab.rb | sed -n '13p;943p'
    13	external_url 'http://192.168.182.143:8888'
   943	nginx['listen_port'] = 8888
   
   #重新配置gitlab
[root@localhost ~]# gitlab-ctl reconfigure
#重启gitlab
[root@localhost ~]# gitlab-ctl restart
</
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值