CentOS gitlib 環境搭建和問題總結

            **CentOS gitlib 環境搭建和問題總結**

   由於部門自動化測試腳本越來越龐大,需要的代碼分支也越來越多,爲此在今年起需要代碼分支管理工具來進行管理,綜合市面上主流的代碼分支管理工具,最終選用了免費版的gitlib,恰好部門也有現成CentOS 服務器;
   下面爲環境安裝步驟:
   1.首先下載gitlib的安裝包,安裝鏡像可以選擇清華源:
      sudo  yum -y install wget      // 安裝wget
      sudo wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
      下載大概在15分鐘左右,看網速和資源
      ![在這裏插入圖片描述](https://img-blog.csdnimg.cn/20200320104849544.PNG#pic_center)
    2.進行gitlib 安裝:
      安裝gitlab 安裝命令:rpm -i gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
    ![在這裏插入圖片描述](https://img-blog.csdnimg.cn/20200320105122396.PNG?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xmZl8xOTg4,size_16,color_FFFFFF,t_70)
    如圖就安裝完成,安裝中斷,就重新安裝;
    3..將SSH服務設置成開機自啓動,安裝命令:sudo systemctl enable sshd  
    4 .啓動SSH服務,安裝命令:sudo systemctl start sshd
    5.由於centos 可能使用firewalld或者iptable 其中一種防火牆;
     5.1 使用firewalld:
          yum install firewalld systemd -y    //安裝防火牆
          service firewalld  start      //啓動防火牆
          sudo firewall-cmd --permanent --add-service=http     //添加http服務
           sudo systemctl reload firewalld                //重載防火牆
     5.2 使用iptables:
           cd /etc/sysconfig
           vim iptables
           添加gitlib 使用端口,例如8085
           ![在這裏插入圖片描述](https://img-blog.csdnimg.cn/20200320110048533.png)
     6. 給gitlib服務指定端口,以防服務器上各種應用端口衝突;
           vim /etc/gitlib/gitlib.rb
          ![在這裏插入圖片描述](https://img-blog.csdnimg.cn/20200320110329821.png) 
          ![在這裏插入圖片描述](https://img-blog.csdnimg.cn/20200320110438885.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xmZl8xOTg4,size_16,color_FFFFFF,t_70)
          ![在這裏插入圖片描述](https://img-blog.csdnimg.cn/20200320110510689.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xmZl8xOTg4,size_16,color_FFFFFF,t_70)
      7.gitlab-ctl reconfigure     //gitlib更新配置
      8.gitlib-ctl restart  //重啓gitlib
      9.打開瀏覽器http://ip/port  即可登陸

入坑問題1:
gitlib.rb文件中unicon端口一定要設置和centos服務器上未使用的端口;

入坑問題2:
碰到瀏覽器502報錯,一般都是端口被佔用問題,可以換一個其他端口給gitlib

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章