Deploy local Gitlab (CE version) under CENTOS7

Source: Internet
Author: User

1) Operation procedure (Basic Reference Official document https://about.gitlab.com/downloads/#centos7)

[[email protected] ~]# sudo yum install curl policycoreutils  openssh-server openssh-clients -y[[email protected] ~]# sudo systemctl  enable sshd[[email protected] ~]# sudo systemctl start sshd[[email  Protected] ~]# sudo yum install postfix[[email protected] ~]# sudo  systemctl enable postfix[[email protected] ~]# sudo systemctl start  postfix[[email protected] ~]# sudo firewall-cmd --permanent --add-service= httpsuccess[[email protected] ~]# sudo systemctl reload firewalld[[email  protected] ~]# curl -ss https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/ script.rpm.sh | sudo bash[[email protected] ~]# sudo yum install  gitlab-ce  [[email protected] ~]# gitlab-ctl statusrun: gitlab-workhorse:  (pid 15903)  159s;  run: log:  (pid 15726)  198srun: logrotate:  (pid 15822)  186s;  run: log:  (pid 15821)  186srun: nginx:  (pid 15774)  192s; run : log:  (pid 15773)  192srun: postgresql:  (pid 15435)  327s; run:  log:  (pid 15434)  327srun: redis:  (pid 15298)  339s; run: log :  (pid 15297)  339srun: sidekiq:  (pid 15681)  204s; run: log:  (pid 15680)  204srun: unicorn:  (pid 15625)  210s; run: log:  (PID  15624)  210s[[email protected] ~]# gitlab-ctl --helpusage: omnibus-ctl  [options]    -t, --tmp-dir=DIR                 storage location for temporary data[[email protected] ~]#  gitlab-ctl restartok: run: gitlab-workhorse:  (pid 16146)  0sok: run:  logrotate:  (pid 16156)  0sok: run: nginx:  (pid 16162)  1sok:  run: postgresql:  (pid 16173)  0sok: run: redis:  (pid 16175)  1sok:  run: sidekiq:  (pid 16187)  0sok: run: unicorn:  (pid 16193)   0s[[email protected] ~]# gitlab-ctl tail nginx==> /var/log/gitlab/nginx/ current <====> /var/log/gitlab/nginx/error.log <====> /var/log/gitlab/nginx/ gitlab_access.log <==ri/537.36 ". 2743.116 safari/537.36" pplewebkit/537.36  (KHTML, like  gecko)  chrome/52.0.2743.116 safari/537.36 "537.36" 37.36 ". 0; wow64)  applewebkit/537.36   (khtml, like  Gecko)  chrome/52.0.2743.116 safari/537.36 " like gecko)  Chrome/52.0.2743.116  safari/537.36 ",  like gecko)  chrome/52.0.2743.116 safari/537.36" "==> /var/log/ gitlab/nginx/gitlab_error.log <====> /var/log/gitlab/nginx/access.log <==5:in  ' Tail ': interrupts-ctl.rb:575:in  ' run ' s-ctl:31:in  ' <top  (required) > ' from /opt/ gitlab/embedded/bin/omnibus-ctl:22:in  ' Load ' from /opt/gitlab/embedded/bin/omnibus-ctl:22:in  ' <main> ' [[email protected] ~]# cd /opt[[email protected] opt]#  lsgitlab  rh[[email protected] opt]# cd gitlab/[[email protected]  gitlab]# lsbin       etc   license    service  var                     version-manifest.txtembedded  init  licenses  sv        version-manifest.json[[email protected] gitlab]# cd etc/[[email protected]  etc]# ll Total dosage  52-rw-r--r--.  1 root root    80 11 month   28&NBSP;13:42&NBSP;GITLAB-PSQL-RCDRWX------.  3 git  root    38  November  28 13:40 gitlab-rails-rw-r--r--.  1 root root 47471 11 Month  23 &NBSP;02:51&NBSP;GITLAB.RB.TEMPLATEDRWX------.  3 git  root    16  November  28 13:44 gitlab-workhorse[[email protected] etc]# cp gitlab.rb.template After  gitlab.rb.template.20161128 deployment, review the status of Gitlab:[[email protected] code]# gitlab-ctl  statusrun: gitlab-workhorse:  (pid 845)  20880s; run: log:  (pid 843)  20880srun: logrotate:  (pid 28207)  2879s; run: log:  (pid 849)  20880srun: nginx:  ( pid 847)  20880s; run: log:  (pid 846)  20880srun: postgresql:  (PID  854)  20880s; run: log:  (pid 853)  20880srun: redis:  (pid 852 )  20880s; run: log:  (pid 851)  20880srun: sidekiq:  (pid 856)   20880s; run: log:  (pid 855)  20880srun: unicorn:  (pid 842)  20880s;  run: log:  (pid 841)  20880s as we can see, deployment involves a lot of software, it is recommended to use a relatively clean system to deploy

2) Viewing the initialization interface

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/8A/D5/wKioL1g9OseRlnWSAADgfPzDUW8065.png-wh_500x0-wm_3 -wmp_4-s_389390708.png "style=" Float:none; "title=" 20-gitlab.png "alt=" wkiol1g9oserlnwsaadgfpzduw8065.png-wh_50 "/ >

As shown, we need to configure our initial password

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/8A/DA/wKiom1g9OseS-KfAAAD22ZfxDUs623.png-wh_500x0-wm_3 -wmp_4-s_3049318618.png "style=" Float:none; "title=" 21-gitlab interface. png "alt=" Wkiom1g9oses-kfaaad22zfxdus623.png-wh_ "/>

Once configured, we log in using the username root and the password we have set

3) Add a public key to the Gitlab so that it can be authenticated with a private key

[[email protected] code]# ssh-keygen -t  Rsagenerating public/private rsa key pair. enter file in which to save the key  (/ROOT/.SSH/ID_RSA):  /root/. Ssh/id_rsa already exists. overwrite  (y/n)  [[email protected] code]# cd /root/.ssh/[[email protected]  .ssh]# cat id_rsa.pub ssh-rsa aaaab3nzac1yc2eaaaadaqabaaabaqdga/ rqdmlqmr3txzdomjosr0fzyzaynk0uean0frzepn87ah7qv6x3dcc18bcxotsd+o8qfdp8zvyfybxdl+p1r53qq278blxov+atwcl++ ly62olyugtzaadm/cbygttxyqlp83wlutvbmsf3vld3owbmzyfv/uejon+j/ t6zvmc2jycyhdu17hwlsxhzpopm3g1fimmzmlaf12hd76bpfc1ble6gcekmjvj6qtzk4ksl2dwqaalptnw/hlba0qgm4+s74q5woytsvmqoz+ 1h3naxjyqurm5xff+fzx8sg7skyjx/7afkxvuwzypw+ppzpntw1kikugq9aq+rgmt/ [email protected] 

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/8A/D5/wKioL1g9PCaysrhDAACknW21YFg025.png-wh_500x0-wm_3 -wmp_4-s_1353775921.png "title=" 22-gitlab add ssh key. png "alt=" wkiol1g9pcaysrhdaacknw21yfg025.png-wh_50 "/>

Copy the contents of the id_ras.pub to the specified area and save it:

Configure the color for git: [[email protected] code]# git config--global color.ui true[[email protected] code]# git config--listuser.name= Administrator[email protected]color.ui=truecore.repositoryformatversion=0core.filemode=truecore.bare= Falsecore.logallrefupdates=true

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8A/D6/wKioL1g9PurAru6yAABbTAjm8Xo172.png-wh_500x0-wm_3 -wmp_4-s_1142113899.png "style=" Float:none; "title=" 23-Add a new project. png "alt=" WKIOL1G9PURARU6YAABBTAJM8XO172.PNG-WH_50 " />

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/8A/D6/wKioL1g9PuvzZHc1AAD_vFGGevg140.png-wh_500x0-wm_3 -wmp_4-s_3531816671.png "style=" Float:none; "title=" 24.png "alt=" Wkiol1g9puvzzhc1aad_vfggevg140.png-wh_50 "/>

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/8A/D6/wKioL1g9PuzzYh4HAADW4SKN_EM018.png-wh_500x0-wm_3 -wmp_4-s_1877608359.png "style=" Float:none; "title=" 25-project created successfully. png "alt=" Wkiol1g9puzzyh4haadw4skn_ Em018.png-wh_50 "/>

[[email protected] code]# git clone [email protected]:root/cslc.gitcloning  into  ' CSLC ' ...warning: you appear to have cloned an empty  Repository. [[email protected] code]# lscslc  freemind-mmx[[email protected] code]#  cd cslc[[email protected] cslc]# cp /etc/passwd . [[Email protected] cslc]# git add passwd[[email protected] cslc]# git  commit -m  "ADD&NBSP;PASSWD" [master  (root-commit)  8c26f36] add passwd  1 file changed, 43 insertions (+)  create mode 100644 passwd[[email  protected] cslc]# ll -latotal 8drwxr-xr-x. 3 root root    30 nov 29 16:41 .drwxr-xr-x. 5 root root   47 nov &NBSP;29&NBSP;16:40&NBSP, .... drwxr-xr-x. 8 root root 4096 nov 29 16:41 .git-rw-r--r--.  1 root root  2213 Nov 29 16:41 passwd[[email protected] cslc]# git push  -u origin mastercounting objects: 3, done. Delta compression using up to 4 threads. compressing objects: 100%  (2/2),  done. writing objects: 100%  (3/3),  1.04 kib | 0 bytes/s, done. total 3  (delta 0), reused 0  (delta 0) to [email protected]:root/ Cslc.git * [new branch]      master -> masterbranch  master set up to track remote branch master from origin.

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/8A/D6/wKioL1g9QGGy26mCAADnZlLhUl0833.png-wh_500x0-wm_3 -wmp_4-s_3739554522.png "title=" 26.png "alt=" Wkiol1g9qggy26mcaadnzllhul0833.png-wh_50 "/>

4) Add a Readme

[[email protected] cslc]# echo  "Welcome to the Gitlab station of the sports lottery Wuhan" >>readme. md[[email protected] cslc]# lsreadme.md  passwd[[email protected] cslc]#  git add README.md[[email protected] cslc]# git commit -m  "Add  readme "[Master fbe1bfb] add readme 1 file changed, 1 insertion (+ )  create mode 100644 README.md[[email protected] cslc]# git push  -u origin mastercounting objects: 4, done. Delta compression using up to 4 threads. compressing objects: 100%  (2/2),  done. writing objects: 100%  (3/3),  320 bytes | 0 bytes/s, done. total 3  (delta 0), reused 0  (delta 0) to [email protected]:root/ Cslc.git   8c26f36. fbe1bfb  master ->  masterbranch master set up to track remote branch master from  origin.

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/8A/DB/wKiom1g9QgSQ3BkIAABtxKzZWRM402.png-wh_500x0-wm_3 -wmp_4-s_190897512.png "title=" 27.png "alt=" Wkiom1g9qgsq3bkiaabtxkzzwrm402.png-wh_50 "/>

Here, Gitlab's local installation is almost complete.

This article is from the "Frozen vs watermelon" blog, so be sure to keep this source http://molewan.blog.51cto.com/287340/1877804

Deploy local Gitlab (CE version) under CENTOS7

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.