如何搭建GitLab服务器

参考:https://www.cnblogs.com/dotnet261010/p/9811161.html
前置条件:yum update -y(系统升级)
安装vim编辑器:yum install vim -y
1、安装ssh协议:yum install -y curl policycoreutils-python openssh-server
2、启动ssh服务&设置为开机启动:
systemctl enable sshd
systemctl start sshd
3、安装防火墙&开启防火墙
yum install firewalld systemd -y
service firewalld start
4、添加HTTP服务到firewalld,pemmanent表示永久生效,若不加–permanent系统下次启动后就会失效。
firewall-cmd –permanent –add-service=http
5、重启防火墙
systemctl reload firewalld
6、安装Postfix以发送邮件
yum install -y postfix
7、启动postfix并设置为开机启动
systemctl enable postfix
systemctl start postfix
8、安装wget,用于从外网上下载插件
yum -y install wget
9、添加gitlab镜像
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/+最新版本
https://packages.gitlab.com/gitlab/gitlab-ce+最新版本
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-17.0.1-ce.0.el7.x86_64.rpm
10、安装Gitlab
rpm -i +最新版本
rpm -i gitlab-ce-17.0.0-ce.0.el7.x86_64.rpm
11、修改gitlab配置文件指定服务器ip和自定义端口:如:http://xxx.xx.xxx.xxx:9090
vim /etc/gitlab/gitlab.rb
12、将9090端口添加到防火墙中
firewall-cmd –zone=public –add-port=9090/tcp –permanent
13、重启防火墙
systemctl reload firewalld
14、重置gitlab
gitlab-ctl reconfigure
有必要禁用 gitlab-kas
gitlab_kas[‘enable’] = false
15、启动gitlab
gitlab-ctl restart
查看初始密码:cat /etc/gitlab/initial_root_password
------本页内容已结束,喜欢请分享------

感谢您的来访,获取更多精彩文章请收藏本站。

© 版权声明
THE END
喜欢就支持一下吧
点赞15 分享
Tyaco的头像92资源网92资源网
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容