Centos服务器搭建GitLab服务器

Centos服务器搭建GitLab服务器

一、安装依赖软件(命令)

安装ssh

1、安装ssh

sudo yum install -y curl policycoreutils-pythonopenssh-server

2、将SSH服务设置开机自启动

sudo systemctl enable sshd

3、启动SSH

sudo systemctl start sshd

SSH服务有的服务器会自动携带,虚拟机可能需要安装,视情况而定。

关闭防火墙

1、可以将服务添加防火墙通过 --permanent 设定永久。

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

2、重新启动防火墙

sudo systemctl reload firewalld

3、可以直接关闭防火墙(直接此步骤)

systemctl status firewalld.service #查看防火墙状态
systemctl stop firewalld.service #关闭防火墙
systemctl disable firewalld.service #禁止开机启动

安装邮件通知

1、安装Postfix

sudo yum install postfix

2、设置开机启动

sudo systemctl enable postfix

3、启动postfix

sudo systemctl start postfix

安装wget命令

1、查看是否安装wget

wget -v

2、安装wget

yum -y install wget

二、安装gitlab服务器

1、添加gitlab镜像

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

2、安装gitlab

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

3、修改gitlab配置文件,指定服务器ip和端口

vim  /etc/gitlab/gitlab.rb

找到:

external_url ‘ip:端口’

4、启动gitlab

gitlab-ctl reconfigure

gitlab-ctl restart

三、访问gitlab

输入ip+端口号 访问部署gitlab服务,第一次登陆用户名root,密码在文件中查看

/etc/gitlab/initial_root_password

登陆成功后会提示修改密码,如果没有提示,请到admin菜单进行修改。

posted on 2022-03-17 21:56  Chase_Hanky  阅读(219)  评论(0)    收藏  举报