gitlab 官网:https://about.gitlab.com/
注意:安装gitlab分 gitlab-ce 和 gitlab-ee 两个版本,ce 是社区版(免费),ee 是企业版本(付费),并且官方教程是ee版本的,但是两版本安装方式是一样的,只不过需要区分ce 和 ee。
一。安装步骤
1.安装依赖包
sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates
2.邮件配置
sudo apt-get install -y postfix
选择Internet那一项,不带Smarthost的
3.添加gitlab安装包及库
免费版
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
企业版
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
4.安装
sudo apt-get update
sudo apt-get install gitlab-ce 或者 sudo apt-get install gitlab-ee
5.配置访问路径
sudo -e /etc/gitlab/gitlab.rb
修改下图中的路径
6.更新配置
sudo gitlab-ctl reconfigure
7.重启gitlab
sudo gitlab-ctl restart
结果如下图
8.启动sshd和postfix服务
service sshd start
service postfix start
9.查看jitlab服务器状态
sudo gitlab-ctl status
二。gitlab-ctl 常用命令
gitlab-ctl reconfigure # 重载配置
gitlab-ctl check-config # 检查配置并启动
gitlab-ctl diff-config # 将用户配置与包可用配置进行比较
gitlab-ctl status # 查看所有启动组件的进程和状态
gitlab-ctl service-list # 查看所有服务
gitlab-ctl stop # 停止GitLab服务
gitlab-ctl start # 启动GitLab服务
gitlab-ctl restart # 重启GitLab服务
gitlab-ctl once # 如果GitLab服务已停止则启动服务,如果GitLab服务已启动则重启GitLab服务