在自己的服务器上搭建一个gitLab
一、简介
服务器采用的是腾讯的2核4GB的轻量型应用服务器,操作系统镜像CentOS7.6。
二、步骤
1.安装SSH
sudo yum install -y curl policycoreutils-python openssh-server
# 将SSH服务设置成开机自启动
sudo systemctl enable sshd
# 启动SSH服务
sudo systemctl start sshd
2.防火墙开启http
# 添加http命令
sudo firewall-cmd --permanent --add-service=http
# 重启防火墙
sudo systemctl reload firewalld
3.安装Postfix邮件服务
# 安装
sudo yum install postfix
# 设置为开机自启动
sudo systemctl enable postfix
# 启动
sudo systemctl start postfix
4.安装GitLab
# 添加镜像
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
# 安装
rpm -i gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
# 修改配置文件
vim /etc/gitlab/gitlab.rb
external_url 'http://服务器ip:8090'
unicorn['port'] = 8091
gitlab_workhorse['auth_backend'] = "http://localhost:8091"
# 开放端口,端口号随意
firewall-cmd --zone=public --add-port=8090/tcp --permanent
firewall-cmd --reload
# 执行命令
gitlab-ctl reconfigure
gitlab-ctl restart
ip+端口号访问,出现如下页面表示搭建成功了