本文章也是在参考了网上好多相关文章(主要参考文章见文末)后自学整理的,如有错误之处烦请留言指正。
基础环境准备
#安装基础依赖
yum install make cmake gcc gcc-c++
yum install -y wget
#安装ruby
cd /usr/local/src
wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.5.tar.gz
tar -zxvf ruby-2.3.5.tar.gz
cd ruby-2.3.5
./configure
make
make install
ruby -v
cd ../
安装gitlab
#安装依赖
yum install -y curl openssh-server openssh-clients postfix cronie
#打开系统防火墙 HTTP 和 SSH 的访问
service postfix start
chkconfig postfix on
lokkit -s http -s ssh
#使用国内的镜像
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
yum makecache
yum install gitlab-ce
gitlab-ctl reconfigure
vi /etc/gitlab/gitlab.rb
external_url 'http://gitlab.example.com',改为你的域名 / IP
gitlab-ctl reconfigure
#访问地址(ip修改为对应的ip)
http://10.150.27.29
常用命令
#gitlab 启动、停止、重启
gitlab-ctl start/stop/restart
#查看所有日志
gitlab-ctl tail
#查看nginx 访问日志
gitlab-ctl tail nginx/gitlab_acces.log
#查看 postgresql 日志
gitlab-ctl tail postgresql
#查看状态
gitlab-ctl status
主要参考文章:
doc/settings/nginx.md · master · GitLab.org / omnibus-gitlab · GitLab
GitLab 简明安装配置指南 - Hiufan - SegmentFault
我所遇到的GitLab 502问题的解决 - 优快云博客
gitlab简单使用教程 - Wuyuan’s Blog
gitlab的使用 - 刘坤的技术博客
清华大学开源软件镜像站 | Tsinghua Open Source Mirror