CentOS7 GitLab 安装

 

1.安装依赖

$ yum -y install policycoreutils openssh-server openssh-clients postfix 
$ yum install policycoreutils-python

  

2.设置postfix开机自启并启动

$ systemctl enable postfix
$ systemctl start postfix

  

3.下载

$ wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/ol/7/gitlab-ce-12.0.3-ce.0.el7.x86_64.rpm/download.rpm

 

4.解压

$ rpm -i gitlab-ce-12.0.3-ce.0.el7.x86_64.rpm

解压完后会出现如下界面:

CentOS7 GitLab 安装_第1张图片

 

5.修改gitlab配置文件指定服务器ip和自定义端口

vim /etc/gitlab/gitlab.rb

CentOS7 GitLab 安装_第2张图片

 

6.重置并启动GitLab

$ gitlab-ctl reconfigure

  

7.访问 GitLab页面 http://服务器IP:端口

 


 

如果gitlab密码忘记了,可以执行如下步骤:

(1)执行: gitlab-rails console production
[root@localhost gitlab]# gitlab-rails console production
Loading production environment (Rails 4.1.12)
irb(main):001:0>

 

(2)执行: user = User.where(id:1).first
irb(main):001:0> user = User.where(id:1).first
=> #
irb(main):002:0> 

  

(3)执行:user.password='66668888'
irb(main):002:0> user.password='66668888'
=> "66668888"
irb(main):003:0> 

  

(4)执行:user.save!
irb(main):003:0> user.save!
=> true
irb(main):004:0> 

 

 

你可能感兴趣的:(CentOS7 GitLab 安装)