0、Centos7请参照官方文档

https://about.gitlab.com/installation/#centos-7

1. Install and configure the necessary dependencies

下面命令可在gitlab官网找到,【Select an operating system...】选择不同的系统即可查看。

sudo yum install curl openssh-server openssh-clients postfix cronie

# 先修改下面的配置文件再执行启动命令
sudo service postfix start
sudo chkconfig postfix on # 若不执行安装有可能遇到这个错误【lokkit: command not found 】
yum -y install lokkit
sudo lokkit -s http -s ssh

这里安装了postfix,我自行配置了postfix。

vim /etc/postfix/main.cf
myhostname = sample.test.com  ← 设置系统的主机名 mydomain = test.com  ← 设置域名(我们将让此处设置将成为E-mail地址“@”后面的部分) myorigin = $mydomain  ← 将发信地址“@”后面的部分设置为域名(非系统主机名) inet_interfaces = all  ← 接受来自所有网络的请求 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain  ← 指定发给本地邮件的域名 home_mailbox = Maildir/  ← 指定用户邮箱目录

然后测试邮件

echo "Mail Content" | mail -s "Mail Subject" xxxx@xxx.com

若出现【-bash: mail: command not found】执行如下命令:

yum -y install mailx

Note:if you see below warings after you run above command.

send-mail: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol
send-mail: warning: inet_protocols: configuring for IPv4 support only
postdrop: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol
postdrop: warning: inet_protocols: configuring for IPv4 support only

that means you don't have IPv6 configured in your OS's network stack, but your mailer (presumably postfix) is configured to use IPv6. Since there is no IPv6 for your mailer to use, it's warning you that it's only going to use IPv4.

To disable the waring messsage, Go to /etc/postfix/main.cf and change from:

inet_protocols = all

to:

inet_protocols = ipv4

This will only use ipv4 and the warning message will go away.

You will have to issue a stop and start for postfix to register the change.

service postfix restart

查看log,确认邮件发送状态

Postfix邮件的log位置是:/var/log/maillog

发送成功的话,会返回250和OK,也可以去自己的邮件客户端查收。

一切OK的话,那Postfix mail service应该就搭建成功了。

查看邮件队列

postqueue -p

2. Add the GitLab package server and install the package

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce

这里因为网络院线可能会出现下载失败,我尝试了两次后成功了。

3. Configure and start GitLab

sudo gitlab-ctl reconfigure

troubleshooting:

【Error executing action `run` on resource 'execute[semodule -i /opt/gitlab/embedded/selinux/rhel/7/g】

yum install libsemanage-static libsemanage-devel

解决Gitlab的Gravatar头像无法显示的问题

vim /etc/gitlab/gitlab.rb
#把下面这一行的注释去掉即可
gitlab_rails['gravatar_plain_url'] = 'http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'

编辑完gitlab.rb文件后要执行sudo gitlab-ctl reconfigure

解决邮件中URL指向问题

vim /etc/gitlab/gitlab.rb
#将localhost修改为你对应的iP或者域名
external_url 'http://101.101.101.80'

同上,编辑完gitlab.rb文件后要执行sudo gitlab-ctl reconfigure

希望以上笔记能帮助你理解gitlab的官方文档。

技术交流群:576269252

--------------------------------------

声明: 原创文章,未经允许,禁止转载!

--------------------------------------

最新文章

  1. c++模板函数实例化的偏序机制
  2. Linux系统值得一看的学习方法及路线图
  3. flask在windows上用mod_wsgi部署
  4. sql遍历
  5. jQuery操作Table tr td常用的方法
  6. Makefile_:=与=的区别
  7. CSS3动画属性animation的用法
  8. CUBRID学习笔记 45 REPLACE DELETE MERGE 教程
  9. (二)shell中case语句、程序传参、while
  10. C# Winform程序请求管理员权限
  11. Android 应用页面延缓载入
  12. java web 代码
  13. php捕获异常的处理
  14. 用1个 2个3个 5个div实现 十字架
  15. Java7新特性(一)Coin
  16. css3中空格和>的区别
  17. java中volatile
  18. MySQL 使用自增ID主键和UUID 作为主键的优劣比较详细过程(从百万到千万表记录测试)
  19. 执行C#动态代码
  20. balcanced-binary-tree

热门文章

  1. [转] Entity Framework 无法加载指定的元数据资源。
  2. Vue.js使用-组件(上篇)
  3. 每日英语:The Invasion of the Online Tutors
  4. [开源项目-MyBean轻量级配置框架] MyBean的特性和MyBean的开始
  5. Eclipse GBK批量转UTF-8插件
  6. JS操作MongoDB
  7. LeetCode: Reverse Nodes in k-Group 解题报告
  8. Redhat6.5安装DB2 Express-C版本
  9. 如何在linux下查看目录的剩余空间大小
  10. kylin的状态栏(启动器)改成ubuntu之前的样子