yum一鍵安裝gitlab(centos7.x)
1.實驗環境
[root@gitlab ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
2.添加gitlab的yum源倉庫
[root@gitlab ~]# curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
3.安裝gitlab
[root@gitlab ~]# yum -y install gitlab-ee
PS: gitlab-ce 是社區版,免費的;gitlab-ee 是企業版
4.配置gitlab,設置配置文件/etc/gitlab/gitlab.rb 中的 external_url
如果更改默認端口80爲8001(注意不要修改爲8080否則會和默認的unicorn['port'] = 8080衝突),需要修改配置文件(1)和(2):
(1)gitlab配置文件 /etc/gitlab/gitlab.rb
external_url 'http://192.168.33.66' -----> external_url 'http://192.168.33.66:8001',如下圖所示:
(2)nginx配置文件 /var/opt/gitlab/nginx/conf/gitlab-http.conf
5.重載配置生效,然後重啓服務
[root@gitlab ~]# gitlab-ctl reconfigure
[root@gitlab ~]# gitlab-ctl restart
6.訪問主頁
用戶名root,首次登陸需設定密碼,而且密碼至少8位