GitLab是一个基于Git的版本管理系统,可以提供代码仓库、代码审核、问题跟踪等功能。

下面是CentOS7系统上安装GitLab的步骤:

  1. 安装依赖
sudo yum install curl policycoreutils openssh-server openssh-clients 
sudo systemctl enable sshd 
sudo systemctl start sshd 
sudo firewall-cmd --permanent --add-service=http 
sudo systemctl reload firewalld 
  1. 安装PostgreSQL
sudo yum install postgresql-server postgresql-contrib 
sudo postgresql-setup initdb 
sudo systemctl enable postgresql 
sudo systemctl start postgresql 
  1. 修改PostgreSQL配置文件

打开 /var/lib/pgsql/data/pg_hba.conf文件,找到以下行:

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            ident
# IPv6 local connections:
host    all             all             ::1/128                 ident

peer改为 md5,保存文件并退出。

  1. 安装GitLab
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
sudo EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ee

其中,EXTERNAL_URL指定GitLab的地址。

  1. 启动GitLab
sudo gitlab-ctl reconfigure
sudo gitlab-ctl start
  1. 设置管理员密码

访问 http://your-server-ip,根据提示设置管理员密码。

至此,GitLab安装完成。可以登录到GitLab控制台,创建代码仓库、添加开发者等。


香港五网CN2网络云服务器链接:www.tsyvps.com

蓝易云香港五网CN2 GIA/GT精品网络服务器。拒绝绕路,拒绝不稳定。

最后修改:2023 年 05 月 15 日
如果觉得我的文章对你有用,请随意赞赏