1、官方推荐方式安装

参考https://www.gitlab.com.cn/installation/#centos-7?version=ce

sudo yum install -y curl policycoreutils-python openssh-server openssh-clients
sudo systemctl enable sshd
sudo systemctl start sshd

这3行一般都是要执行的

防火墙不启用,那防火墙的命令就不用执行了

建议使用smtp来发邮件,这样就不用装postfix了
现在服务器一般都会禁用25端口,用postfix还要额外配置,所以尽量不要用

sudo EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ce

EXTERNAL_URL用来设置gitlab的访问域名,建议尽量用域名,ip地址有可能会换的

安装命令执行时间较长,大概有几分钟时间,而且期间屏幕有可能会没有任何变化,建议耐心等待

安装完成后,即可访问域名来使用gitlab,发送邮件配置后续再设置

2、指定安装版本

和官方推荐方式基本相同,事先下载安装包,下载地址可以到官网找,也可以去用国内的镜像地址

curl -sS http://packages.gitlab.com.cn/install/gitlab-ce/script.rpm.sh | sudo bash
sudo EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ce

官方的这2行不用执行,换成如下:

curl -LJO https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.1.4-ce.0.el7.x86_64.rpm
rpm -i gitlab-ce-11.1.4-ce.0.el7.x86_64.rpm

第一行下载安装包,第二行执行安装包

安装包安装很快,不用等待很长时间
安装后不能马上使用,必须执行配置和启动命令

gitlab-ctl reconfigure
gitlab-ctl restart

3、使用外部nginx

1) 修改配置文件 /etc/gitlab/gitlab.rb

#定义访问域名
external_url 'http://git.example.com'
#禁用内部 nginx
nginx['enable'] = false
#配置可以访问 gitlab 工作目录的用户,赋予 nginx 用户对该目录的读写权限
web_server['external_users'] = ['nginx','gitlab-www','git']

2) 复制内部nginx的配置文件到外部nginx

/var/opt/gitlab/nginx/conf/gitlab-http.conf 和 /var/opt/gitlab/nginx/conf/nginx-status.conf

gitlab-http.conf还需要做适当修改,主要是将原来内部nginx的nginx.conf里的几行配置复制进gitlab-http.conf

proxy_cache_path proxy_cache keys_zone=gitlab:10m max_size=1g levels=1:2;
proxy_cache gitlab; map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}

3) 执行 gitlab-ctl reconfigure 重新配置gitlab

4、配置smtp发送邮件

修改配置文件gitlab.rb

gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = 'gitlab@example.com'
gitlab_rails['gitlab_email_display_name'] = 'GitLab'
gitlab_rails['gitlab_email_reply_to'] = 'noreply@example.com' gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.mxhichina.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "gitlab@example.com"
gitlab_rails['smtp_password'] = "********"
gitlab_rails['smtp_domain'] = "example.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true

以上配置是阿里云企业邮箱的配置,注意smtp_port设置为465,则smtp_tls必须设为true

其他邮箱配置可参考网上

参考网址:

https://wsgzao.github.io/post/gitlab/
https://yq.aliyun.com/articles/208700
https://laravel-china.org/topics/2829/centos-7-install-gitlab-ce-community-edition-and-modify-the-default-nginx

Centos7安装gitlab-ce的更多相关文章

  1. centos7安装gitlab并汉化

    一.基础环境准备 1.安装依赖包 [root@gitlab-server ~]#yum install curl policycoreutils openssh-server openssh-clie ...

  2. CentOS7安装GitLab、汉化及使用

    同步首发:http://www.yuanrengu.com/index.php/20171112.html 一.GitLab简介 GitLab是利用Ruby On Rails开发的一个开源版本管理系统 ...

  3. CentOS7安装GitLab、汉化、邮箱配置及使用

    同步首发:http://www.yuanrengu.com/index.php/20171112.html 一.GitLab简介 GitLab是利用Ruby On Rails开发的一个开源版本管理系统 ...

  4. Centos7安装GitLab

    GitLab CE Download Archives gitlab安装调试小记 Gitlab Free Trial GitLab搭建手记 Gitlab社区版的使用 GUI PNG Gitlab升级到 ...

  5. Centos7 安装gitLab

    我这里使用的是centos 7 64bit,我试过centos 6也是可以的! 1. 安装依赖软件 yum -y install policycoreutils openssh-server open ...

  6. Centos7安装Docker CE

      每次安装Docker都要去找文档,或者每次安装的都不一样,还是要好好管理自己的这些东西,下次用的时候可以省很多的时间   Docker的早期版本称为docker或docker-engine:现在的 ...

  7. centos7 安装gitlab任意版本

    主要还是根据官网:https://www.gitlab.cc/installation/#centos-7 1.安装依赖: sudo yum install curl policycoreutils ...

  8. CentOs7安装gitlab(转!)

    沧浪之水清兮,可以濯吾缨; 沧浪之水浊兮,可以濯吾足.                                                                         ...

  9. centos7安装gitlab与gitlab的汉化

    Gitlab概述 GitLab是一个利用 Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目.  GitLab拥有与Github ...

  10. CentOS7安装GitLab、汉化、邮箱配置及使用(转载)

    同步首发: https://www.cnblogs.com/heyonggang/p/7778203.html http://www.yuanrengu.com/index.php/20171112. ...

随机推荐

  1. 使用HSSFWorkbook导出、操作excel

    原文地址:https://www.jianshu.com/p/dd1e4f28757b 在实际开发中我们经常需要导入数据,统计数据,并且将统计好的数据导出excel,今天分享一个导出学生信息的方法. ...

  2. 物联网开源框架Thingsboard使用总结

    Thingsboard中文社区:http://thingsboard.iotschool.com/ 参考网址:https://thingsboard.io/docs/getting-started-g ...

  3. centos7下NAT模式下设置静态ip

    1.在虚拟网络编辑器下查看子网IP.子网掩码以及网关 2.在Linux系统中进入 /etc/sysconfig/network-scripts目录下,编辑ifcfg-ens33文件,改成下面的内容: ...

  4. SpringCloud踩坑

    今天在使用 SpringCloud 时遇到了一个问题,感觉有不少小伙伴会遇到,所以记录下来 版本说明 SpringBoot 2.2.4.RELEASE SpringCloud Greenwich.SR ...

  5. PHP0021:PHP COOKIE 设置修改删除

  6. C#实现图片文件到数据流,再到图片文件的转换

    //----引入必要的命名空间 using System.IO; using System.Drawing.Imaging; //----代码部分----// private byte[] photo ...

  7. java使用原生MySQL实现数据的增删改查以及数据库连接池技术

    一.工具类及配置文件准备工作 1.1 引入jar包 使用原生MySQL,只需要用到MySQL连接的jar包,maven引用方式如下: <dependency> <groupId> ...

  8. LOJ6287 诗歌

    题意 给定一个排列,问是否存在\(\forall a,b,a\neq b\)满足\(2|(a+b)\)且\(\frac{a+b}{2}\)在\(a,b\)间 做法 枚举中点\(a\),即需要存在类似\ ...

  9. hdu 1011 Starship Troopers(树上背包)

    Problem Description You, the leader of Starship Troopers, are sent to destroy a base of the bugs. Th ...

  10. 微信小程序后端开发流程

    微信小程序后端开发流程根据官网总结为两个步骤 1.前端调用 wx.login 返回了code,然后调用wx.getUserInfo获取到用户的昵称 头像 2.服务端根据code去微信获取openid, ...