CentOS7中安装Gitlab-ee企业版(完整教程)

官方文档:下载安装_极狐GitLab - 极狐GitLab 官方网站

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

系统开放http、https、ssh访问,可能有些系统没有安装防火墙使用的是其他安全组件,最后两行可以不执行

sudo yum install -y curl policycoreutils-python openssh-server perl
# Enable OpenSSH server daemon if not enabled: sudo systemctl status sshd
sudo systemctl enable sshd
sudo systemctl start sshd
# Check if opening the firewall is needed with: sudo systemctl status firewalld
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld

安装邮件服务器,用于发送邮件通知,如果使用其他解决方案发送电子邮件,请跳过此步骤

sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix

2. 下载并安装GitLab包

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash

用于安装启动后访问gitlab,这里如果使用https的话安装之后还需要做一些额外的配置

sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ee

直接安装,安装之后在编辑访问url,直接安装使用:

sudo yum install -y gitlab-ee

安装完成以后修改文件,设置访问地址external_urlhttp://127.0.0.1:8090/gitlab

vim /etc/gitlab/gitlab.rb
##! Note: During installation/upgrades, the value of the environment variable
##! EXTERNAL_URL will be used to populate/replace this value.
##! On AWS EC2 instances, we also attempt to fetch the public hostname/IP
##! address from AWS. For more details, see:
##! https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
external_url 'http://127.0.0.1:8090/gitlab'

重新应用gitlab的配置

gitlab-ctl reconfigure

3. 查看并修改密码

cat /etc/gitlab/initial_root_password

修改生成的项目地址中的IP地址 127.0.0.1

# 编辑
vim /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
​
# 重启GitLab
gitlab-ctl restart

下一篇:Docker中安装Gitlab-ce

你可能感兴趣的:(centos,linux,服务器,gitlab)