CentOS 7 搭建 GitLab 服務器步驟

準備工做

安裝依賴

yum install -y curl policycoreutils-python openssh-server

將SSH服務設置成開機自啓動

systemctl enable sshd

啓動SSH服務

systemctl start sshd

安裝防火牆

yum install firewalld systemd -y

開啓防火牆

service firewalld  start

添加http服務到firewalld

pemmanent表示永久生效,若不加--permanent系統下次啓動後就會失效python

firewall-cmd --permanent --add-service=http

重啓防火牆

systemctl reload firewalld

(額外可不安裝)安裝Postfix以發送通知郵件

yum install postfix

(額外可不安裝)將postfix服務設置成開機自啓動

systemctl enable postfix

(額外可不安裝)啓動postfix

systemctl start postfix

安裝必要組件 Wget(有可忽略)

yum -y install wget

安裝必要組件 vim編輯器(有可忽略)

yum install vim -y

開始安裝 GitLab

添加gitlab鏡像

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

安裝gitlab

該步驟安裝時間較長,請耐心等待git

rpm -i gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

修改gitlab配置文件指定服務器ip和自定義端口

vim  /etc/gitlab/gitlab.rb

找到 external_url 修改其中的值爲具體的訪問地址vim

external_url 'http://192.168.1.1'

從新配置gitlab

gitlab-ctl reconfigure

重啓 gitlab

gitlab-ctl restart

訪問

訪問地址爲上面 external_url 所配置的地址 http://192.168.1.1 第一次登陸的時候須要進行初始化一下密碼服務器

參考原文地址ssh

相關文章
相關標籤/搜索