centos7搭建gitLab服務

先查看當前系統的版本號   cat /etc/redhat-release

 

 

 

版本是 : CentOS Linux release 7.6.1810 (Core)

查看內存使用情況 free -h

 

查看當前端口狀態 netstat -ntlp

80 端口已經被用了

開始搭建服務

安裝git

yum install git  

檢查git版本 git --version

git config --global user.name "xxxxxx"

git config --global user.email "[email protected]"

git config --global core.editor vim  

1. 安裝依賴軟件

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

2.設置postfix開機自啓,並啓動,postfix支持gitlab發信功能

systemctl enable postfix && systemctl start postfix

3. yum install policycoreutils-python

獲取安裝包

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

安裝

rpm -i gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

顯示上圖表示安裝成功

 

4.修改gitlab配置文件指定服務器ip和自定義端口:

vim /etc/gitlab/gitlab.rb

進入編輯器後按“i”鍵進入編輯狀態,ESC鍵退出編輯狀態

退出並保存,命令輸入“:wq”

ps:注意這裏設置的端口不能被佔用,默認是8080端口,如果8080已經使用,請自定義其它端口,並在防火牆設置開放相對應得端口  這裏用的是8010端口

查看開放端口命令

firewall-cmd --list-ports

開放8010端口

firewall-cmd --zone=public --add-port=8010/tcp --permanent 

再查看開放端口

firewall-cmd --list-ports 

重啓firewall  

firewall-cmd --reload  

如果有以下提示,則表明防火牆未開啓

FirewallD is not running

開啓防火牆

systemctl start firewalld

5.重置並啓動GitLab

gitlab-ctl reconfigure

gitlab-ctl restart

 

gitlab-ctl start # 啓動所有 gitlab 組件;
gitlab-ctl stop # 停止所有 gitlab 組件;
gitlab-ctl restart # 重啓所有 gitlab 組件;
gitlab-ctl status # 查看服務狀態;
gitlab-ctl reconfigure # 啓動服務;
vim /etc/gitlab/gitlab.rb # 修改默認的配置文件;
gitlab-rake gitlab:check SANITIZE=true --trace # 檢查gitlab;
gitlab-ctl tail # 查看日誌;

然後訪問

管理員賬號爲

root

 

 

檢查gitLab版本號

cat /opt/gitlab/embedded/service/gitlab-rails/VERSION

漢化

gitlab-ctl stop

yum -y install git

克隆獲取漢化版本庫

git clone https://gitlab.com/xhang/gitlab.git

cd /root/gitlab/

git diff v10.0.0 v10.0.0-zh >/tmp/10.0.0-zh.diff

yum install patch -y

patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < /tmp/10.0.0-zh.diff

 

啓動

gitlab-ctl start

重新配置

gitlab-ctl reconfigure

 

 

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