在學習gitlab時,記下筆記如何安裝gitlab
1、準備一台centos7 虛拟機
記憶體4GB
磁盤40GB
2、修改IP位址和hostname檔案
1、
vi /etc/sysconfig/network-scripts/ifcfg-ens33
//新安裝的沒有将網卡打開,在這裡将ONBOOT修改為yes
//儲存退出
2、我沒有修改ip位址(自行百度)
3、修改主機名(友善widows浏覽器通路)
vi /etc/hostname/
//注意:不是hostsname
3、準備gitlab安裝包
我的是gitlab-ce-13.0.5-ce.0.el7.x86_64.rpm
附上下載下傳位址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
放在 /opt/module/ 目錄下(沒有就建立)
4、安裝(離線安裝)
為了友善,學習了某位老師的方法,寫了一個安裝腳本,如下
sudo rpm -ivh /opt/module/gitlab-ce-13.0.5-ce.0.el7.x86_64.rpm
sudo yum install -y curl policycoreutils-python openssh-server cronie
sudo lokkit -s http -s ssh
sudo yum install -y postfix
sudo service postfix start
sudo chkconfig postfix on
curl https://packages.gitlab .com/install/repositories/gitlab/gitlab-ce/script.rpm.sh / sudo | bash
sudo EXTERNAL_URL="http:/ /gitlab . example.com" yum -y install gitlab-ce
執行 chmod +x gitlab-install.sh
再執行 ./gitlab-install.sh
等待出現 nothing to do 就成功了
5、初始化gilab
gitlab-ctl reconfigure
等待幾分鐘
出現 gitlab Reconfigured! 即可
6、啟動
gitlab-ctl start //啟動
gitlab-ctl stop // 關閉
7、修改windows host檔案通路
192.168.xxx.xxx gitlab-server //修改後的hostname主機名
浏覽器輸入 gitlab-server 通路
修改密碼
修改的是root使用者的密碼
over