阿里云ESC 部署 GitLab-ce 并配置使用外部 nginx
最近试着在阿里云的 ESC 上部署了一下 GitLab 的社区版本,并且使用了非内嵌的 nginx 服务,遇到不少坑,特意记录一下。
首先是安装 GitLab 社区版,具体安装的流程按照官网的说明来进行。GitLab 官方提供了 Omnibus包安装、社区提供的安装方法、和官方的其他安装方法。这里推荐使用 Omnibus 包来安装,这也是官方推荐的方式。用这个包安装部署gitlab,便于后期的配置修改和更新。Omnibus 包安系统版本分为不同的包,我的系统是 Centos7的,所以采用对应7的安装包。步骤如下:
GitLab 服务安装部署完成,接下来是配置该服务使用外部的 nginx 来访问。
一 官方Centos7的安装说明地址
https://www.gitlab.com.cn/installation/
1.安装相关依赖,打开系统防火墙的 HTTP 和 SSH的访问。
sudo yum install curl policycoreutils openssh-server openssh-clients sudo systemctl enable sshd sudo systemctl start sshd sudo yum install postfix sudo systemctl enable postfix sudo systemctl start postfix sudo firewall-cmd --permanent --add-service=http sudo systemctl reload firewalld
2.添加GitLab 镜像源并安装
curl -sS https://packages.gitlab.com.cn/install/gitlab-ce/script.rpm.sh | sudo bash sudo yum install gitlab-ce
3.配置并启动服务
4.通过访问上面配置的域名来重新设置管理员密码。sudo gitlab-ctl reconfigure
最后更新:2017-09-14 19:32:57