[TOC] # 安装依赖 ``` yum install -y curl policycoreutils-python openssh-server systemctl enable sshd systemctl start sshd firewall-cmd --permanent --add-service=http sudo systemctl reload firewalld ``` #邮件配置(可选) ``` yum install  postfix systemctl enable postfix systemctl start postfix ``` # gitlab的仓库地址 ## 配置国内地址 ``` vi /etc/yum.repos.d/gitlab-ce.repo [gitlab-ce] name=Gitlab CE Repository baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/ gpgcheck=0 enabled=1 ``` ## 下载 ``` curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash ``` #安装gitlab ## 设置域名 ``` sudo EXTERNAL_URL="gitlab.k8spm.com" yum install -y gitlab-ce ``` > gitlab.k8spm.com为安装配置的域名,在本地hosts设置域名映射 ## 无域名 ``` yum install -y gitlab-ee ``` # configure 如果没有成功,可以运行gitlab-ctl reconfigure # 查看gitlab进程 `gitlab-ctl status` #访问 `浏览器输入gitlab.k8spm.com` > 修改root密码 # 修改生效 ``` vi /etc/gitlab/gitlab.rb 修改完成之后一定要gitlab-ctl reconfigure ``` # 启动、停止、重启 ``` gitlab-ctl start #启动 gitlab-ctl stop #停止 gitlab-ctl restart # 重启 ```