CentOS安装gitlab

来源:互联网 发布:多核编程的艺术 编辑:程序博客网 时间:2024/06/10 02:22

最近在搞gitlab,一开始在ubuntu上安装的,那个过程简直是痛不欲生。可能是因为人品不好的缘故吧,中间出现了各种错误;一度几乎让我产生了放弃的念头,后来发现很多都是用的CentOS来安装gitlab。于是,抱着试一试的心情就又进行了一次尝试,没想到,出奇的顺利。现记下安装过程,以便以后查阅。


首先,过程主要是按照官方来的:https://about.gitlab.com/installation/


1.安装并配置必要的依赖关系

sudo yum install curl policycoreutils openssh-server openssh-clientssudo systemctl enable sshdsudo systemctl start sshdsudo yum install postfixsudo systemctl enable postfixsudo systemctl start postfixsudo firewall-cmd --permanent --add-service=httpsudo systemctl reload firewalld

2.添加GitLab包服务器并安装包

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

这个地方容易出现问题,可能是被墙的原因,https://packages.gitlab.com/gitlab/gitlab-ce  这是官方包的瞎子啊地址,各种包都有,选择匹配的下载即可。


也可以直接用以下命令:

curl -LJO https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-XXX.rpm/downloadrpm -i gitlab-ce-XXX.rpm

3.配置并启动GitLab


sudo gitlab-ctl reconfigure

4.浏览到主机名并登录


在您第一次访问时,您将被重定向到密码重置屏幕,以提供初始管理员帐户的密码。输入您想要的密码,您将被重定向回登录屏幕。

默认帐户的用户名是root提供您之前创建的密码并登录。登录后,您可以更改用户名。