centos 安装gitlab

1.开始安装依赖软件:yum -y install policycoreutils openssh-server openssh-clients postfix

2.设置postfix开机自启动,postfix支持gitlab发信功能:systemctl enable postfix && systemctl start postfix

如果出现:

Job for postfix.service failed because the control process exited with error code. See "systemctl status postfix.service" and "journalctl -xe" for details.

vim /etc/postfix/main.cf

inet_protocols = ipv4
inet_interfaces = all

3.下载gitlab包(建议去网站下载最新版本https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/?C=M&O=A)

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.3.3-ce.0.el7.x86_64.rpm

rpm -i gitlab-ce-11.3.3-ce.0.el7.x86_64.rpm

如果报错:

error: Failed dependencies:

policycoreutils-python is needed by gitlab-ce-10.7.3-ce.0.el7.x86_64

安装环境

yum install policycoreutils-python

别的网站下载后有时候会报错

4.修改gitlab 端口和ip

vim /etc/gitlab/gitlab.rb

IP地址+端口号: external_url ‘http://192.168.0.217:8010‘

5.配置并启动gitlab

gitlab-ctl reconfigure (可能会一段时间)

gitlab-ctl restart

下图表示成功

6.页面打开 如果出现这个错误

1.更改端口号 vim  /etc/gitlab/gitlab.rb(更改后要重新运行)

gitlab-ctl reconfigure (可能会一段时间)

gitlab-ctl restart

2.权限问题,解决方法:chmod -R 755 /var/log/gitlab

3.内存大于4G

7.首次进入会让你修改密码:修改后进入

.后来把端口改为8081后就可以了

9.创建用户

1.点击小工具

2.添加user

10.关于发送邮箱。postfix默认用的25端口,但是阿里云又不让开启25端口。

 vim /etc/gitlab/gitlab.rb

gitlab_rails[‘smtp_enable‘] = true
gitlab_rails[‘smtp_address‘] = "smtp.qq.com"
gitlab_rails[‘smtp_port‘] = 465
gitlab_rails[‘smtp_user_name‘] = "[email protected]"  # 你自己QQ号
gitlab_rails[‘smtp_password‘] = "*************"             # QQ授权码
gitlab_rails[‘smtp_domain‘] = "smtp.qq.com"
gitlab_rails[‘smtp_authentication‘] = "login"
gitlab_rails[‘smtp_enable_starttls_auto‘] = true
gitlab_rails[‘smtp_tls‘] = true
gitlab_rails[‘gitlab_email_from‘] = ‘[email protected]‘   # 你自己QQ号

3.打开自己的qq邮箱

打开QQ邮箱-设置-账户-帐户安全-开启服务-POP3/SMTP服务-生成授权码-发个短信

gitlab-ctl reconfigure 重新配置

4.进入gitlab-rails console

Notify.test_email(‘yoyo_你自己随便邮箱@qq.com‘, ‘邮件标题_test‘, ‘邮件正文_test‘).deliver_now

[[email protected]cdxc43mxwv5uwZ ~]# gitlab-rails console
-------------------------------------------------------------------------------------
 GitLab:       11.11.0 (3e8ca2fb781)
 GitLab Shell: 9.1.0
 PostgreSQL:   9.6.11
-------------------------------------------------------------------------------------
Loading production environment (Rails 5.1.7)
irb(main):001:0> Notify.test_email(‘[email protected]‘,‘标题党‘,‘正文‘).deliver_now
Notify#test_email: processed outbound mail in 189.3ms
Sent mail to [email protected] (1514.7ms)
Date: Mon, 27 May 2019 15:56:21 +0800
From: GitLab <[email protected]>
Reply-To: GitLab <[email protected]>
To: [email protected]
Message-ID: <[email protected]>
Subject: =?UTF-8?Q?=E6=A0=87=E9=A2=98=E5=85=9A?=
Mime-Version: 1.0
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit
Auto-Submitted: auto-generated
X-Auto-Response-Suppress: All

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><p>正文</p></body></html>

=> #<Mail::Message:70328290558700, Multipart: false, Headers: <Date: Mon, 27 May 2019 15:56:21 +0800>, <From: GitLab <[email protected]>>, <Reply-To: GitLab <[email protected]>>, <To: [email protected]>, <Message-ID: <[email protected]>>, <Subject: 标题党>, <Mime-Version: 1.0>, <Content-Type: text/html; charset=UTF-8>, <Content-Transfer-Encoding: 7bit>, <Auto-Submitted: auto-generated>, <X-Auto-Response-Suppress: All>>
irb(main):002:0> exit()
[[email protected] ~]#

5.现在创建用户就会发送邮件

原文地址:https://www.cnblogs.com/elsons/p/10931288.html

时间: 2024-07-30 21:56:39

centos 安装gitlab的相关文章

转载:centos安装gitlab详解

原文地址:http://blog.csdn.net/jiangtao_st/article/details/73612298 一, 服务器快速搭建gitlab方法 可以参考gitlab中文社区 的教程centos7安装gitlab:https://www.gitlab.cc/downloads/#centos7centos6安装gitlab:https://www.gitlab.cc/downloads/#centos6如下方法按照官网来操作,手工安装过于麻烦.当前测试平台为小鸟云的三个月cen

CentOS安装GitLab

最近想写一些小程序,但是GitHub没有免费的private,想到写的程序还得需要部署和MySQL数据库,索性就买一个阿里云的云主机,还挺便宜,一年才600多. 下午安装了JDK.Tomcat.MySQL,现在开始安装GitLab: 安装和配置依赖的环境. sudo yum install curl openssh-server postfix cronie sudo service postfix start sudo chkconfig postfix on sudo lokkit -s h

CentOS安装gitlab,gerrit,jenkins并配置ci流程

By Wenbin [email protected] 2016/4/9 这是我参考了网上很多的文档,配置了这三个软件在一个机器上,web分别访问8081,8082,8083端口,成功构建了一个ci流程. 版本都是目前最新的版本. 用户 Gitlab:  root/wenbindevops , wenbin/12345678 Gerrit:  gerrit/gerrit, wenbin/wenbin, jenkins/jenkins Jenkins:  jenkins/jenkins 主机192

【GitLab】CentOS安装GitLab最佳实践

环境 [root@iZ2851te7e5Z ~]# lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch Distributor ID: CentOS Description: CentOS Linux release 7.1.1503 (Core) Release: 7.1.1503 Codename: Core 服务器安装了 PHP7 Nginx,占用80端口 Mysql 安装 安装采用官网提供的安装方法. 进入页面 http

centos 安装 gitlab

按照官方教程的步骤:https://about.gitlab.com/downloads/#centos6 但是执行这一步 curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash sudo yum install gitlab-ce 会报错找不到镜像文件. 所以我自己下载了rpm 文件在安装. 步骤如下: sudo yum install openssh-se

CentOS6.5安装GitLab全过程

GitLab,是一个使用 Ruby on Rails 开发的开源应用程序,与Github类似,能够浏览源代码,管理缺陷和注释,非常适合在团队内部使用. 官方只提供了Debian/Ubuntu系统下的安装说明文档,如果需要在centos下安装,可以参考这篇:https://github.com/gitlabhq/gitlab-recipes/tree/master/install/centos,笔者依照这篇文章的说明,成功的在centos系统上安装了gitlab,分享一下自己的安装过程和碰到的问题

CentOS源码安装GitLab汉化版

示例环境: 软件 版本 CentOS 6.5 x86_64 Git 2.6.2 Ruby 2.2.3 Node.js 4.2.1 Redis 3.0.5 MariaDB 10.0.21 GitLab 8.0.5汉化版 GitLab Shell 2.6.6 Nginx 1.8.0 Go 1.5.1 Gitlab-git-http-server 0.2.14 一.修改Yum源为阿里云提高下载速度 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.

centos 7 安装gitlab

#配置安装EPEL及依赖环境 #更新包     yum update      yum -y install wget yum -y --nogpgcheck install http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm#添加epel源      http://www.cnblogs.com/Irving/p/3729074.html    #安装所需依赖包     yum -y

centos 6.5安装GitLab全过程和问题记录

GitLab,是一个使用 Ruby on Rails 开发的开源应用程序,与Github类似,能够浏览源代码,管理缺陷和注释,非常适合在团队内部使用. 官方只提供了Debian/Ubuntu系统下的安装说明文档,如果需要在centos下安装,可以参考这篇:https://github.com/gitlabhq/gitlab-recipes/tree/master/install/centos,笔者依照这篇文章的说明,成功的在centos系统上安装了gitlab,分享一下自己的安装过程和碰到的问题