gitlab安装与配置(Centos6.8) yum安装gitlab

   2023-02-09 学习力0
核心提示:0、Centos7请参照官方文档https://about.gitlab.com/installation/1. Install and configure the necessary dependencies下面命令可在gitlab官网找到,【Select an operating system...】选择不同的系统即可查看。sudo yum install curl openssh-server opens

0、Centos7请参照官方文档

https://about.gitlab.com/installation/

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

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

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

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

 
反对 0举报 0 评论 0
 

免责声明:本文仅代表作者个人观点,与乐学笔记(本网)无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
    本网站有部分内容均转载自其它媒体,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责,若因作品内容、知识产权、版权和其他问题,请及时提供相关证明等材料并与我们留言联系,本网站将在规定时间内给予删除等相关处理.

  • 用Xshell设置CentOS密钥登录
    用Xshell设置CentOS密钥登录
    今天带来设置X shell 密钥登录  因为用的中文x shell 所以按照中文设置很简单1.点击工具(Tools)------新建用户密钥生成向导(New User key Wizard)(附图)2.然后出现下图时,记得密钥类型 选择RSA.其实选择DSA ,也能实现,二者其实是不同的算法。(我用的R
    03-08
  • centOS下安装Adobe Flash Player
    centOS下安装Adobe Flash Player
    centOS下安装Adobe Flash Player  2009-10-09 11:29:33|  分类:linux|  标签: |订阅 写出来就这么简单几步,当初刚接触Linux的时候搜索了很长时间,找了很多资料,总是出现这样那样的问题,最后终于摸索出最简单最有效的安装的方法。 随便打开一个带
    03-08
  • 部署Node.js项目(CentOS) node项目搭建
    部署Node.js项目(CentOS) node项目搭建
    操作步骤步骤 1:创建ECS实例选择操作系统为公共镜像CentOS7.2。使用root用户登录Linux实例。步骤2:部署Node.js环境—二进制文件安装该部署过程使用的安装包是已编译好的二进制文件,解压之后,在bin文件夹中就已存在node和npm,无需手工编译。安装步骤:1、
    02-10
  • centos安装python与jdk centos安装python3.7
    centos安装python与jdk centos安装python3.7
    安装python#压缩包安装[root@china ~]# yum -y install zlib*Loaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun
    02-10
  • centos6下同时安装python2和python3
    #build-essential compile packagesyum groupinstall "Development Tools"yum install openssl-develyum install zlib-develyum install make gcc gcc-c++ kernel-develhttp://unix.stackexchange.com/questions/291737/zipimport-zipimporterror-cant-decomp
    02-10
  • CentOS下查看文件和文件夹大小 linux查看文件夹
    当磁盘大小超过标准时会有报警提示,这时如果掌握df和du命令是非常明智的选择。  df可以查看一级文件夹大小、使用比例、档案系统及其挂入点,但对文件却无能为力。当磁盘大小超过标准时会有报警提示,这时如果掌握df和du命令是非常明智的选择。  df可以查
    02-10
  • centos7 离线升级/在线升级操作系统内核
    centos7 离线升级/在线升级操作系统内核
    centos7 离线升级/在线升级操作系统内核目录一.前言二.系统环境三.系统内核下载网址四.centos7离线升级系统内核1.先查看系统环境2.离线升级系统内核五.在线升级系统内核一.前言CentOS(Community ENTerprise Operating System)是Linux发行版之一,它是来自于
    02-10
  • centos7 rc.local脚本执行不成功
    腾讯云 centos7   配置文件/etc/rc.local的内容如下:#!/bin/sh#secu_agent init monitor, install at Thu Aug 3 11:19:41 CST 2017/usr/local/sa/agent/init_check.sh/dev/null 21/usr/sbin/ntpdate ntpupdate.tencentyun.com /dev/null 21 /usr/local/qclo
    02-10
  • 如何在centos7启动时自动挂载硬盘
    在/etc/rc.local中加入如下的语句,这样就不用每次重启后手动挂载了(后面挂载的目录根据自己的需求而定):mount  /dev/sdb1 /usr/sharedfiles/sdbmount  /dev/sdc1 /usr/sharedfiles/sdcmount  /dev/sdb1 /root/sdbmount  /dev/sdc1 /root/sdc注意:可以
    02-10
  • centos7.2 开启防火墙
    开启防火墙当我们修改了某些配置之后(尤其是配置文件的修改),firewall并不会立即生效。可以通过两种方式来激活最新配置 systemctl restart firewalld 和 firewall-cmd --reload 两种方式,前一种是重启firewalld服务,建议使用后一种“重载配置文件”
    02-10
点击排行