🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
官方推荐运行gitlab的服务器的内存至少在4GB以上,推荐采用omnibus软件包安装 Centos6系统上安装 第一步: 安装并配置依赖关系 [www@server01 ~]$ sudo yum install curl policycoreutils policycoreutils-python cronie openssh-server openssh-clients postfix -y 开通http,https,ssh访问 [www@server01 ~]$ sudo lokkit -s http -s https -s ssh 查看iptables防火墙 [www@server01 ~]$ sudo cat /etc/sysconfig/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT 启动postfix邮箱服务 [www@server01 ~]$ sudo service postfix start && sudo chkconfig postfix on [www@server01 ~]$ chkconfig --list |grep postfix postfix 0:off 1:off 2:on 3:on 4:on 5:on 6:off 第二步:安装GitLab软件包库并安装软件包 1、下载指定版本的gitlab-ce 软件官方:https://packages.gitlab.com/gitlab/gitlab-ce 以安装10.2.2为例 [www@server01 ~]$ curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash 2、安装gitlab-ce软件 [www@server01 ~]$ sudo yum install gitlab-ce-10.2.2-ce.0.el6.x86_64 由于国内用户安装慢,建议采用如下方式 采用国内清华大学的镜像源 安装gitlab-ce软件 [www@server01 yum.repos.d]$ sudo cat /etc/yum.repos.d/gitlab-ce.repo [gitlab-ce] name=gitlab-ce baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/ repo_gpgcheck=0 gpgcheck=0 enabled=1 gpgkey=https://packages.gitlab.com/gpg.key [www@server01 ~]$ sudo yum -y install gitlab-ce ![](https://box.kancloud.cn/706b39ba7959b09e464bac88c2d3e72b_297x23.png) 第三步: 配置并启动gitlab-ce [www@server01 ~]$ sudo gitlab-ctl reconfigure 查看状态 [www@server01 ~]$ sudo gitlab-ctl status run: gitaly: (pid 5172) 33s; run: log: (pid 4660) 113s run: gitlab-monitor: (pid 5188) 33s; run: log: (pid 4829) 91s run: gitlab-workhorse: (pid 5160) 34s; run: log: (pid 4483) 142s run: logrotate: (pid 4595) 124s; run: log: (pid 4594) 124s run: nginx: (pid 4548) 131s; run: log: (pid 4547) 131s run: node-exporter: (pid 4746) 102s; run: log: (pid 4745) 102s run: postgres-exporter: (pid 5210) 31s; run: log: (pid 4994) 68s run: postgresql: (pid 4111) 211s; run: log: (pid 4110) 211s run: prometheus: (pid 5197) 32s; run: log: (pid 4934) 74s run: redis: (pid 3985) 222s; run: log: (pid 3984) 222s run: redis-exporter: (pid 4877) 80s; run: log: (pid 4876) 80s run: sidekiq: (pid 4428) 153s; run: log: (pid 4427) 153s run: unicorn: (pid 4364) 159s; run: log: (pid 4363) 159s [www@server01 ~]$ ss -tunlp|grep 80 tcp LISTEN 0 128 127.0.0.1:8080 *:* tcp LISTEN 0 128 *:80 *:* tcp LISTEN 0 128 *:8060 *:* 第四步:测试访问 ![](https://box.kancloud.cn/c19a6020908afbb5a397b1600e9af5b1_1300x619.png) (设置密码:Aa123456) Centos7系统 1、安装依赖 [www@server02 ~]$ sudo yum -y install curl openssh-server policycoreutils-python openssh-clients cronie postfix [www@server02 ~]$ sudo systemctl enable sshd [www@server02 ~]$ sudo systemctl enable httpd [www@server02 ~]$ sudo systemctl start sshd [www@server02 ~]$ sudo systemctl start httpd [www@server02 ~]$ sudo firewall-cmd --permanent --add-service=http [www@server02 ~]$ sudo firewall-cmd --permanent --add-service=https [www@server02 ~]$ sudo systemctl reload firewalld 2、安装postfix邮箱 [www@server02 ~]$systemctl enable postfix [www@server02 ~]$systemctl start postfix 3、安装gitlab 这个跟在centos6上的差不多