CentOS7如何搭建Gitlab服务器

第一步:安装ssh
yum install -y curl policycoreutils-pythonopenssh-server

第二步: 将SSH服务设置成开机自启动并启动SSH服务(若安装并启动,则可跳过此步)
sudo systemctl enable sshd
sudo systemctl start sshd

第三步:安装并启动防火墙(若安装并启动,则可跳过此步)
yum install firewalld systemd -y
service firewalld start

第四步:添加http服务到firewalld (–permanent表示永久生效)
firewall-cmd --permanent --add-service=http

第五步:重启防火墙;
systemctl reload firewalld

第六步:将postfix服务设置成开机自启动并启动postfix;
systemctl enable postfix
systemctl start postfix

第七步:检查系统中是否已经安装wget(若不存在,用yum安装wget)
wget -V --检查wget版本
yum -y install wget --yum安装wget
CentOS安装必要的依赖

第一步:wget下载gitlab(社区版)
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.2.1-ce.0.el7.x86_64.rpm

第二步:安装gitlab;
rpm -i gitlab-ce-11.2.1-ce.0.el7.x86_64.rpm

第三步 配置gitlab
sudo gitlab-ctl reconfigure
若出现错误,需要安装 policycoreutils-python;
yum -y install policycoreutils-python

第四步 启动
sudo gitlab-ctl start
#centos7 防火墙 允许80端口或是其他指定端口
#sudo firewall-cmd --permanent --zone=public --add-port=80/tcp
#我的是8084端口,所以要加进去。
sudo firewall-cmd --permanent --zone=public --add-port=8084/tcp

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

3、修改Gitlab默认访问端口
–1更改端口
vim /etc/gitlab/gitlab.rb
输入内容:
external_url ‘http://why-small.com:8084/’
nginx[‘listen_port’] = 8084

–2 改nigx端口
vim /var/opt/gitlab/nginx/conf/gitlab-http.conf
查找如下内容并修改:

重置配置:gitlab-ctl reconfigure
重启gitlab服务:gitlab-ctl restart

第五步:访问Gitlab,初次登录,修改密码;
初始用户:root
初始密码:5iveL!fe

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值