gitlab installation and use

centOS6.5 quick installation and deployment of gitLab

In the process of program development, git has become the most popular code hosting tool, and the famous open source platform github is derived from this tool. It brings convenience and speed to our code management, but on github, only open source public projects can Free trial, if the company's private project, you must pay for it, and the price is not low. So today, this article will share with you a fool-like, simple and fast deployment and installation of gitlab services in the centOS 6.5 environment.

what is gitlab


GitLab is an open source version management system using Ruby on Rails to implement a self-hosted Git project repository that can access public or private projects through a web interface. It has similar functionality to Github, with the ability to browse source code, manage bugs and comments. It manages the team's access to the repository, it is very easy to browse committed versions and provides a file history repository. Team members can use the built-in simple chat program (Wall) to communicate. It also provides a code snippet collection function that can easily reuse code, which is easy to find when needed in the future


Installation Notes

GitLab has 2 versions, GitLab Community Edition (CE) and GitLab Enterprise Edition (EE). CE is the free version. We are installing the CE version today.

The GitLab official website provides installation kits for CentOS / Debian / Ubuntu systems. Today we are going to install GitLab on CentOS 6.5.

Installation preparation

We directly use the rpm installation method provided by the official, GitLab official address You can find your corresponding installation OS system through this address, and you can directly see the installation prompt method corresponding to this system.


There is no need to install git , ruby ​​or web server in the middle, because the official one integrates most of the packages (nginx, ruby ​​& rails , git , redis , postgresql ...)


Download GitLab and install

  • download
curl -O https://downloads-packages.s3.amazonaws.com/centos-6.5/gitlab-7.2.1_omnibus-1.el6.x86_64.rpm
  • After the download is complete
yum install openssh-server
sudo yum install postfix
sudo service postfix start
sudo chkconfig postfix on

Install the above in turn, and then install

rpm -i gitlab-7.2.1_omnibus-1.el6.x86_64.rpm

Modify the external domain name or ip

vi /etc/gitlab/gitlab.rb

After opening, there is a line of external_url setting changed to the url to open the web to the outside world. For example, I can specify git.yijiebuyi.com for internal use or change it to an internal IP address such as http://192.168.0.11.

Execute GitLab

sudo gitlab-ctl reconfigure
sudo lokkit -s http -s ssh

If you run the above command and find that lokkit is not installed, you need to manually yum install lokkit lokkit can help us set iptables to open http and ssh


access via web

The open domain name or ip just set above, then you can access it in the browser, so even if the official installation is successful.gitstart.jpg.png

initial password

  • Account: root
  • Password: 5iveL

After the initial login, the interface for resetting the password will appear, and the management interface can create groups and invite members.

Stop GitLab

Just enter gitlab-ctl stop directly in the console.

Restart

Enter gitlab-ctl start directly in the console

GitLab directory storage

GitLab stores the directory to /var/opt/gitlab by default. If you want to move, backup this directory. It is safer to stop GitLab first, then back up the directory, and finally restart GitLab.

From: centOS6.5 quick installation and deployment of gitLab

 

 
GitLab changes root user password

GitLab是一个私有的Git仓库,具有较好的项目管理和用户管理能力。 
对于普通用户而言,通过系统的重置密码,接受邮件即可解决,可是GitLab的管理员账号,缺省的邮箱是一个不存在的邮箱地址,所以没有办法通过邮箱来复位。 
通过在服务器上,可以修改用户的密码: 
官方修改密码:(http://docs.gitlab.com/ce/security/reset_root_password.html
不过,笔者通过该方法是,发现,不能使用引号来包括密码。 
具体方法如下: 
1. 在root用户下,执行

gitlab-rails console production
  • 1
  1. 获得用户数据,修改用户密码
[root@svr34 bin]# gitlab-rails console production
Loading production environment (Rails 4.2.5.2)
irb(main):001:0> user = User.where(id: 1).first
=> #<User id: 1, email: "[email protected]", ...
irb(main):002:0> user.password=12345678
=> 12345678
irb(main):003:0> user.password_confirmation=12345678
=> 12345678
irb(main):004:0> user.save!
=> true
irb(main):005:0> quit
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

注意:密码没有使用引号,奇怪的是使用单引号或双引号,密码就无效,估计是包含了这个字符,不包含,就没有问题。 
3. 保存用户数据

user.save!
  • 1

注意需要使用后面的感叹号!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326348656&siteId=291194637