Centos6搭建git

来源:互联网 发布:淘宝开服装店教程 编辑:程序博客网 时间:2024/06/05 07:41

新建 /etc/yum.repos.d/gitlab-ce.repo,内容为

[gitlab-ce]name=Gitlab CE Repositorybaseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/gpgcheck=0enabled=1gpgkey=https://packages.gitlab.com/gpg.key
  1. 安装配置依赖项

如想使用Postfix来发送邮件,在安装期间请选择’Internet Site’. 您也可以用sendmai或者 配置SMTP服务 并 使用SMTP发送邮件.

在 Centos 6 和 7 系统上, 下面的命令将在系统防火墙里面开放HTTP和SSH端口.

sudo yum install curl openssh-server openssh-clients postfix croniesudo service postfix startsudo chkconfig postfix onsudo lokkit -s http -s ssh
  1. 添加GitLab仓库,并安装到服务器上
curl -sS http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh | sudo bashsudo yum makecachesudo yum install gitlab-ce

问题:
出现页面502
原因:由于unicorn默认使用的是8080端口。
解决办法:打开/etc/gitlab/gitlab.rb,打开# unicorn[‘port’] = 8080 的注释,将8080修改为9090,保存后运行

sudo gitlab-ctl reconfigure

修改默认80端口

修改默认80端口

修改external_url ‘http://localhost:8888’ 保存退出。
刷新配置:

sudo gitlab-ctl reconfigure

安装Git

yum –y install git
原创粉丝点击