VMware Pro15虛擬機器中安裝centos8並且安裝Git伺服器的解決方法
好多開發人員一般都是用Windows10開發系統,那麼在windows10下如何安裝Git伺服器呢,那麼要借用虛擬機器中安裝CentOS8版的Linux系統
具體步驟如下:
第一、windows10安裝Workstation 15 Pro ,然後在Workstation 15 Pro 安裝CentOS8
在windows10的虛擬機器軟體中安裝CentOS8版的Linux系統,具體如何Workstation 15 Pro 安裝CentOS8 請看博文:https://blog.csdn.net/chenzhf_0122/article/details/102964037
第二、CentOS8安裝好之後用root身份登入linux系統分別執行以下命令,(安裝和啟用policycoreutils、openssh-server和openssh-clients元件,並將它們開放防火牆(不要忘了reload防火牆))
# dnf install -y curl policycoreutils openssh-server openssh-clients # systemctl enable sshd # systemctl start sshd # firewall-cmd --permanent --add-service=http # firewall-cmd --permanent --add-service=https # systemctl reload firewalld
與郵件通知相關的Postfix元件其實可以暫時不用安裝和配置,這個可以放到後面再來配置一個外部的SMTP伺服器:
# dnf install postfix # systemctl enable postfix # systemctl start postfix
第三步、使用curl工具下載並配置GitlabCE版RPM安裝包的倉庫配置指令碼(請確認你的虛擬機器能聯接網路,注意這只是RPM安裝包的倉庫配置指令碼,並不是真正的安裝包)
# curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | bash
第四、安裝Gitlab客戶端,這個域名一定是要自己可以訪問到的
EXTERNAL_URL="http://www.axinno1.com" dnf install -y gitlab-ce
第五、編輯 /etc/gitlab/gitlab.rb 如果沒有要編輯的就 在dos控制檯中按Esc 在按:wq! 指令
vim /etc/gitlab/gitlab.rb
第六、編輯了的話就要重新配置下Gitlab
[root@localhost ~]# gitlab-ctl reconfigure
gitlab-ctl 客戶端命令:
[root@localhost ~]# gitlab-ctl reconfigure #重讀配置 [root@localhost ~]# gitlab-ctl start #啟動 [root@localhost ~]# gitlab-ctl restart #重啟 [root@localhost ~]# gitlab-ctl status #檢視服務狀態 [root@localhost ~]# gitlab-ctl stop #停止 [root@localhost ~]# gitlab-ctl stop nginx #單獨停止nginx [root@localhost ~]# gitlab-ctl tail #檢視日誌 /opt/gitlab/ #gitlab程式安裝目錄 /var/opt/gitlab/ #gitlab資料目錄 /var/opt/gitlab/git-data/ #倉庫目錄
參照資料:
https://www.cnblogs.com/forlive/p/12469187.html
https://blog.csdn.net/chenzhf_0122/article/details/102964037