设为首页 收藏本站
查看: 949|回复: 0

[经验分享] gitlab安装与配置(Centos6.8)

[复制链接]

尚未签到

发表于 2018-1-10 17:51:51 | 显示全部楼层 |阅读模式
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、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-433640-1-1.html 上篇帖子: 在ubuntu 16.04下安装gitlab(摘抄中文官方网站) 下篇帖子: Gitlab部署(中文版)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表