Centos7搭建GitLab伺服器

2021-10-02 18:10:11 字數 1571 閱讀 8082

1.安裝相關依賴

yum -y install policycoreutils openssh-server openssh-clients postfix policycoreutils-python
主要是郵件服務postfix

2.修改 /etc/postfix/main.cf的設定

vi /etc/postfix/main.cf
新增配置

inet_inte***ces = all

接受所有網路的請求

3.啟動postfix,並設定其開機自啟動

systemctl enable postfix && systemctl start postfix
wget
可選擇自己需要的版本

5.安裝gitlab

rpm -ivh gitlab-ce-12.7.5-ce.0.el7.x86_64.rpm
安裝完成後會出現gitlab的圖示,並提示接下來的操作

根據提示修改external_url為http://ip:埠,這個是gitlab的訪問位址

vi /etc/gitlab/gitlab.rb
修改gitlab.rb的external_url後儲存

6.重置並啟動gitlab

重置:

gitlab-ctl reconfigure
重置過程比較長,用時6分51秒.....

重啟:

gitlab-ctl restart
出現以下ok: run的提示說明啟動成功

7.設定gitlab開機自啟

systemctl enable gitlab-runsvdir.service
此時通過剛才設定的ip:埠就可以訪問gitlab頁面,若不能訪問,可能是防火牆未開放訪問埠,使用以下命令開放防火牆埠

firewall-cmd --zone=public --add-port=埠號/tcp --permanent
8.修改root使用者密碼,通過ip:埠訪問gitlab頁面,會提示輸入新密碼,確定後即可通過root/密碼登入

登入後頁面

gitlab安裝完成,可以使用了

Centos7 搭建 Gitlab 服務

1 安裝基礎包 yum y install curl policycoreutils openssh server openssh clients2 啟動 sshd systemctl enable sshd systemctl start sshd3 新增防火牆規則 yum install git...

基於CentOS 7 搭建 GitLab

系統要求 centos 7.2 64 位作業系統 yum update y 安裝 sshd yum install y curl policycoreutils python openssh server 啟用並啟動 sshd systemctl enable sshd systemctl star...

基於CentOS7搭建GitLab

2 安裝gitlab 3 初始化gitlab 4 gitlab安裝已完成 在正式開始安裝之前,先更新軟體包並開啟相關服務的許可權 yum update yyum install y curl policycoreutils python openssh serversystemctl enable ...