gitlab安装与配置

最近在学习gitlab 并改善公司的代码托管和发布流程

安装详细教程可以参考官网:https://about.gitlab.com/install/

一、安装与配置

以下是我自己的安装流程

#安装依赖
yum install -y curl policycoreutils-python openssh-server postfix

#安装 gitlab yum源 (国外地址 比较慢)
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash

安装gitlab
yum install -y gitlab-ee

#修改配置
gitlab-ctl start #启动gitlab

gitlab-ctl
reconfigure #配置gitlab

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

#找到host修改 为本机ip地址

vim /etc/gitlab/gitlab.rb

#找到 external_url 打开注释 并修改为 external_url 'http://ip:port/gitlab/'

#找到 unicorn['worker_processes'] 打开注释 并修改为 unicorn['worker_processes'] = 2

#修改gitlab 自带 nginx 的访问端口

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

#修改listen的端口 与上面external_url 的端口对应

#重新加载gitlab配置
gitlab-ctl reconfigure

 

以上操作使用root权限

 二、配置邮件postfix

 

 

注意:

1.gitlab很吃内存 我在1核2G内存机器上勉强可以跑起来,不过会经常报502,所以建议用4G内存的机器去跑

2.执行gitlab-ctl reconfigure 前 先把gitlab停了,因为内存问题可能会卡死

3.gitlab 的 unicorn 默认占用8080端口 所以确保你的端口是否被占用

4.gitlab 自带nginx,端口80,如果和本机nginx冲突 那么就要修改配置了 具体参考:https://www.jianshu.com/p/123778a515ca

 

 

待补充。。。

 

posted @ 2020-02-19 16:27  KenChung  阅读(379)  评论(0编辑  收藏  举报