Linux安装gitlab

第一步、安装相关依赖:

1

yum install -y curl policycoreutils-python openssh-server

第二部、启动ssh服务 设置开机启动

1

systemctl enable sshd && systemctl start sshd

第三部、设置postfix 开机启动,postfix 支持gitlab发信功能

1

systemctl enable postfix && systemctl start postfix

第四部、开放ssh 以及http服务然后重新加载防护墙列表

1

2

3

4

5

firewall-cmd --add-service=ssh --permanent

firewall-cmd --add-service=http --permanent

firewall-cmd --reload

第五部、下载gitlab 并安装

1

2

3

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.4.8-ce.0.el7.x86_64.rpm

https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el8/gitlab-ce-14.9.3-ce.0.el8.x86_64.rpm

rpm -i gitlab-ce-12.4.8-ce.0.el7.x86_64.rpm

下面是小编安装的 77%是当时网不行,后来直接浏览器下载 放服务器的 

 https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.4.8-ce.0.el7.x86_64.rpm

第六部、修改/etc/gitlab/gitlab.rb

在/etc/gitlab/gitlab.rb文件中,修改两个地方:

1.gitlab默认端口80,但是80端口很多时候会被占用,所有改为82;ip地址改为该服务器的ip;

2.gitlab默认需nginx服务器监听,也要改该文件中的nginx监听端口;

修改gitlab配置文件信息,指定服务ip和端口号

1

2

3

4

5

6

7

vim /etc/gitlab/gitlab.rb

external_url '

unicorn['port']=8101    这个就填在external_url 下防止端口冲突不然有可能502

  

nginx['listen_port'] = 82

external_url 这个在20几行左右

nginx['listen_port']  搜索一下吧 下面不远

第七部、重载配置及启动gitlab

这个需要几分钟

1

2

3

gitlab-ctl reconfigure

gitlab-ctl restart

相关操作

 启动服务:gitlab -ctl start

 查看状态:gitlab -ctl status

 停掉服务:gitlab -ctl stop

 重启服务:gitlab -ctl restart

 让配置生效:gitlab -ctl reconfigure

第八部、82端口加入防火墙白名单

1

2

3

sudo firewall-cmd --add-port=82/tcp --permanent

firewall-cmd --reload

第九步、卸载gitlab 

1、停止gitlab

gitlab-ctl stop
2、卸载gitlab(注意这里写的是gitlab-ce)
rpm -e gitlab-ce
3、查看gitlab进程
ps aux | grep gitlab

4、杀掉第一个进程(就是带有好多.............的进程)

kill -9 18777
杀掉后,在ps aux | grep gitlab确认一遍,还有没有gitlab的进程

5、删除所有包含gitlab文件

find / -name gitlab | xargs rm -rf

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值