一、Centos6.5安装gitlab
1.1 Gitlab下载地址
# 本文下载的是gitlab-ce-12.6.0-ce.0.el6.x86_64
# 注意下载的Git版本与CentOS版本对应
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/
1.2 安装
# 注意如果提示:
# Failed dependencies:
# policycoreutils-python is needed by gitlab-ce-12.6.0-ce.0.el6.x86_64
# 请安装依赖
yum install policycoreutils-python
# 安装gitlab
rpm -i gitlab-ce-12.6.0-ce.0.el6.x86_64.rpm
1.3 初始化Gitlab配置并启动(过程比较慢)
# 初始化配置,并启动
sudo gitlab-ctl reconfigure
1.4 访问地址
http://localhost 或者直接把localhost更换为ip地址
# 外网访问不到,关闭防火墙
# CentOS6
# 查看防火墙状态
service iptables status
# 临时防火墙关闭
service iptables stop
# 永久关闭防火墙
chkconfig iptables off
# CentOS7关闭防火墙
systemctl stop firewalld
二、Ubuntu18安装gitlab
2.1 Gitlab下载地址
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu/pool/trusty/main/g/gitlab-ce/gitlab-ce_11.8.0-ce.0_amd64.deb
2.2 安装Gitlab
dpkg -i gitlab-ce_11.8.0-ce.0_amd64.deb
2.3 初始化Gitlab配置并启动,此过程比较慢
gitlab-ctl reconfigure
三、使用官网
# 官网的安装方法如下
https://packages.gitlab.com/gitlab/gitlab-ce/install#bash-rpm
# 可以自行ip地址,编辑gitlab.rb文件
vim /etc/gitlab/gitlab.rb
## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
external_url 'http://gitlab.example.com'
四、常用命令
# 启动Gitlab
gitlab-ctl start
# 停止Gitlab
gitlab-ctl stop
# 查看服务状态
gitlab-ctl status
# 查看日志
gitlab-ctl tail