天天看點

gitlab下載下傳安裝及部署

1. 安裝依賴軟體
yum -y install policycoreutils openssh-server openssh-clients postfix
2.設定postfix開機自啟,并啟動,postfix支援gitlab發信功能
systemctl enable postfix && systemctl start postfix
3.下載下傳gitlab安裝包,然後安裝
[gitlab的下載下傳位址:](https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/)https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
rpm -ivh gitlab-ce-14.2.4-ce.0.el7.x86_64.rpm
4.修改gitlab配置檔案指定伺服器ip和自定義端口      -->更改gitlab預設端口
vim  /etc/gitlab/gitlab.rb 
external_url 'http://192.168.2.130:8099'
修改内容:external_url後改為自己的http://ip:端口;
5:使用gitlab-ctl reconfigure 自動配置,并安裝資料庫,初始化資訊(第一次使用配置時間較長):
6:使用gitlab-ctl status 檢視gitlab服務的狀态
 指令:gitlab-ctl start --啟動gitlab服務。
       gitlab-ctl stop   --停止服務
       gitlab-ctl stop nginx --單獨停止某個服務
       gitlab-ctl reconfigure --啟動服務
       gitlab-ctl start --啟動所有gitlab元件
       gitlab-ctl tail  --檢視所有服務的日志
7.gitlab-ctl reconfigure      #更改配置檔案後需重新配置
/opt/gitlab/                #gitlab的程式安裝目錄
/var/opt/gitlab             #gitlab目錄資料目錄
/var/opt/gitlab/git-dfata   #存放倉庫資料
8.在浏覽器中輸入 http://ip:端口/ ,然後 change password: ,并使用root使用者登入 即可 (後續動作根據提示操作)