centos 7 部署gitlab

1、 更新yum源

curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
完毕!
Generating yum cache for gitlab_gitlab-ce...
导入 GPG key 0xE15E78F4:
 用户ID     : "GitLab B.V. (package repository signing key) "
 指纹       : 1a4c 919d b987 d435 9396 38b9 1421 9a96 e15e 78f4
 来自       : https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
Generating yum cache for gitlab_gitlab-ce-source...

The repository is setup! You can now install packages.
[root@zouxuan ~]# yum search gitlab
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
===================================================================== N/S matched: gitlab =====================================================================
gitlab-ce.x86_64 : GitLab Community Edition (including NGINX, Postgres, Redis)

2、安装gitlab

yum install gitlab-ce.x86_64

3、 配置gitlab

gitlab默认端口为8080,但是可能被占用,nginx一般占用80,nuicorn默认为8080,查看端口是否被占用。

指令:netstat -npl

centos 7 部署gitlab_第1张图片

修改gitlab默认端口

vi /etc/gitlab/gitlab.rb

修改:

nginx['listen_port'] = 8070

unicorn['port'] = 8090

修改gitlab nginx web服务器的监听端口

vi /var/opt/gitlab/nginx/conf/gitlab-http.conf

修改:

4、重新加载配置 

 gitlab-ctl reconfigure

5、启动服务

gitlab-ctl start
ok: run: alertmanager: (pid 60088) 0s
ok: run: gitaly: (pid 60097) 0s
ok: run: gitlab-exporter: (pid 60116) 0s
ok: run: gitlab-workhorse: (pid 60118) 1s
ok: run: grafana: (pid 60128) 1s
ok: run: logrotate: (pid 60138) 0s
ok: run: nginx: (pid 60146) 1s
ok: run: node-exporter: (pid 60152) 0s
ok: run: postgres-exporter: (pid 60160) 1s
ok: run: postgresql: (pid 60171) 1s
ok: run: prometheus: (pid 60181) 0s
ok: run: redis: (pid 60188) 0s
ok: run: redis-exporter: (pid 60201) 0s
ok: run: sidekiq: (pid 60330) 0s
ok: run: unicorn: (pid 60345) 0s

6、配置clone地址

vi /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml

修改:

7、访问gitlab

地址: 192.168.12.35:8070

账号root,密码自己设置

centos 7 部署gitlab_第2张图片

你可能感兴趣的:(linux,gitlab,配置安装)