栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

安装部署Gitlab

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

安装部署Gitlab

1 安装相关依赖
yum -y install policycoreutils openssh-server openssh-clients postfix
2 配置系统环境
systemctl enable sshd    #启动ssh服务
systemctl start sshd      #设置开机启动
systemctl enable postfix && systemctl start postfix  #设置postfix开机自启并启动 postfix支持gitlab发信功能

firewall-cmd --add-service=ssh --permanent
firewall-cmd --add-service=http --permanent
firewall-cmd --reload             #开放ssh以及http服务 然后重新加载防火墙列表
如果关闭防火墙上面这三步就不需要配置

systemctl stop firewalld     #停止firewalld防火墙服务
systemctl disable firewalld    #禁用firewalld服务开机自启
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux  #关闭selinux 重启生效
setenforce 0     #关闭selinux 当前生效
3 添加清华大学yum源
[root@localhost ~]vim /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

[root@localhost ~]# yum makecache      #更新本地yum缓存
4 安装Gitlab

yum安装

yum install -y gitlab-ce   #安装最新版gitlab


可以访问"https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/"查看Gitlab-ce的版本。
yum install -y gitlab-ce-{VERSION}  #安装历史版本

或者包安装

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

###也可以提前下载版本的rpm包上传至服务器 https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/

rpm -ivh gitlab-ce-12.4.2-ce.0.el6.x86_64.rpm    #安装
5 修改gitlab配置
vim /etc/gitlab/gitlab.rb

简单修改配置

修改gitlab访问地址和端口,默认为80,我们改为82
external_url 'http://192.168.66.100:82'
nginx['listen_port'] = 82     


gitlab-ctl reconfigure   #重载配置
gitlab-ctl restart     #启动gitlab
6 网页登录测试

http://xxx.xxx.xxx.xxx:82
网页登录后用户名root 密码目录为
/etc/gitlab/initial_root_password

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/827996.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号