ubuntu install gitlab

Similarly gitlab github, can be used to manage the code. Of course, in addition to the two of them have a lot of code management tool, but also domestic. In my article will talk about the installation process gitlab. But gitlab not lightweight stuff, take about 4 ~ 8G of memory, especially merge code more time, amount of memory will increase.

If the novice installation, we recommend that you use docker installation, direct download others already installed, download over a few modify the configuration just fine. Such changes will be relatively much simpler.

ubuntu system

My system is ubuntu 18.04

https://www.jianshu.com/p/74a3a181dc36

Installation Commands

sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates
sudo apt-get install -y postfix

Use left and right keys and the Enter key to select OK, Cancel, when the pop-up list of options, select Internet Site

GPG public key of the trust GitLab

curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null

Path Configuration Mirror

Find here the mirror path

https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/

vi /etc/apt/sources.list.d/gitlab-ce.list

Write

deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial main

The installation gitlab-ce

sudo apt-get update
sudo apt-get install gitlab-ce

Perform configuration

sudo gitlab-ctl reconfigure

I configured here there was error, then modified after Baidu

sudo vim /etc/gitlab/gitlab.rb

Then re-run

sudo gitlab-ctl reconfigure

Start gitlab

sudo gitlab-ctl start

Browser access

My computer is 192.168.2.104 ip

http:电脑的IP地址:端口号

Normal, I do not normally have access to. So we have the following things.

By default, it is port 80, but port 80 is typically occupied by other, so we need to modify the port number.

Configuring gitlab root account and password

#cd /opt/gitlab/bin && sudo gitlab-rails console production


#u=User.where(id:1).first




#u.password = 'YOUR_PASSWORD' 
#u.password_confirmation = 'YOUR_PASSWORD'


#u.save!


irb(main):004:0> u.save!
Enqueued ActionMailer::DeliveryJob (Job ID: 4847c99e-eac6-4ed7-94aa-6d7de597a4bd) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", gid://gitlab/User/1
=> true


See the last plane out of a true, it shows the configuration gitlab root account password success.

Port configuration gitlab

Port configured here

sudo vim /etc/gitlab/gitlab.rb

There are two, one for 8091 and one 8900. 8900 is the last test I found the correct port.

  • Test port and ip address is bound to use the command

telnet 192.168.2.104 8091

Successes and failures will be two different results.

After you configure ports need to use the command

sudo service gitlab-runsvdir restart

Start this service, service gitlabxx behind the tab key automatically filled.

Web access gitlab

To enter the account password here, it is to configure the account password above us.

Acknowledgments: Thanks for the McDonald's and eat with me man to call me support.

PS: 1 + 1 with McDonald's heart has always been my favorite.


  回复「 篮球的大肚子」进入技术群聊

回复「1024」获取1000G学习资料

发布了397 篇原创文章 · 获赞 820 · 访问量 73万+

Guess you like

Origin blog.csdn.net/weiqifa0/article/details/104471239