Linux安装gitlib

一、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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值