windows10搭建gitlab服務器


gitlab服務器沒有win運行環境,所以需要先搭建個虛擬機:windows10+VMware(Centos7) +gitlab+局域網其他電腦訪問

一:VMware 安裝,網上找找有安裝教程

 

 

二:虛擬機鏡像下載:阿里雲鏡像下載

http://mirrors.aliyun.com/centos/7.9.2009/isos/x86_64/

 

 

三:安裝虛擬機:沒有特殊什么,一路下一步

注意:需要特殊注意的是網絡類型使用NAT,不然centos7虛擬機無法上網

 

 

這里選擇NAT模式:

 

 四:配置虛擬機:

 

 

 

 

 

 

點擊安裝-》輸入root用戶密碼。

 

 

 等待安裝!!!

 

 

 

 

 設置密碼,登錄。查看能否上網。

 

 

 五:安裝git

官方地址:https://about.gitlab.com/install/?version=ce#centos-7

需要注意的是,我們安裝的是社區版,注意看這里。根據官方文檔一步一步安裝即可。

 

 

 

 

sudo yum install -y curl policycoreutils-python openssh-server openssh-clients perl
# Enable OpenSSH server daemon if not enabled: sudo systemctl status sshd
sudo systemctl enable sshd
sudo systemctl start sshd

# Check if opening the firewall is needed with: sudo systemctl status firewalld
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld
不需要郵箱相關操作時,可以先忽略這里

sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
這里需要替換為自己的域名

sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ce

 

 

 

 六:我這邊安裝后沒有找到root默認密碼。所以自己修改了下密碼。

 
         
#進入管理終端 
 sudo gitlab-rails console -e production
#查詢 
user = User.where(id: 1).first

#設置密碼 user.password=‘12345678’

#確認密碼 user.password_confirmation = '12345678'

#保存不然不生效 user.save!

 

 然后在虛擬機瀏覽器訪問鏈接,登錄成功。

 

七:局域網內其他電腦訪問

上面是在centos虛擬機里面訪問有效,在局域網其他電腦無法訪問

1: 查看ip

 

 

 

 

 

 2:設置虛擬機網絡。編輯-》虛擬機網絡編輯器

 

 

 

 

 

 

 

 

 調整后再次進入虛擬機,連接網絡,查看ip,發現ip發生變化。該ip在局域網其他電腦能訪問。然后使用DNS解析將前面安裝git服務器添加的域名綁定到該ip。其他電腦訪問域名也能成功了。

 

 

參考文檔:

https://about.gitlab.com/install/?version=ce#centos-7

https://www.cnblogs.com/zuxing/articles/8718591.html

https://blog.csdn.net/tsundere_x/article/details/104263100

https://www.cnblogs.com/cj8988/p/9454178.html

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM