centos服务器搭建安装Gitlab教程使用教程

1、更新服务器:

bash 复制代码
sudo yum update -y && sudo yum upgrade -y

2、下载Gitlab的RPM包

bash 复制代码
https://packages.gitlab.com/gitlab/gitlab-ce

ce表示开源

el表示centos   选64位

el8对应CentOS8

本教程以centos8为例,在服务器中,下载centos8的rpm包:

bash 复制代码
cd / && sudo yum install -y wget && sudo wget https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/8/gitlab-ce-16.5.0-ce.0.el8.x86_64.rpm/download.rpm

3、安装依赖:

bash 复制代码
sudo yum install policycoreutils-python-utils -y

4、用rpm命令安装Gitlab的rpm包:

bash 复制代码
rpm -ivh gitlab-ce-16.5.0-ce.0.el8.x86_64.rpm

5、安装成功,会显示类似的内容:

bash 复制代码
Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
  sudo gitlab-ctl reconfigure

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

Help us improve the installation experience, let us know how we did with a 1 minute survey:
https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=15-0

6、打开Gitlab配置文件,配置项目IP访问地址:

bash 复制代码
vim /etc/gitlab/gitlab.rb


#配置项目的访问地址和端口
external_url 'http://XXX.XXX.XXX.XXX:6868'
#由于默认端口被占用,这里指定监听端口为 6868
nginx['listen_port'] = 6868
gitlab_pages['listen_proxy'] = "XXX.XXX.XXX.XXX:6868"

7、配置完执行生效命令:

bash 复制代码
sudo gitlab-ctl reconfigure

执行完,最后看到如下提示,则表示新配置应用成功!

INFO: Cinc Client Run complete in 51.157296534 seconds

8、 查看服务状态:

bash 复制代码
gitlab-ctl status

看到如下信息,这表示服务正在运行中:

9、Gitlab安装初始化后,默认账户名是 root ,密码存放在配置里。查看初始化密码命令:

bash 复制代码
#查看gitlab初始密码
cat /etc/gitlab/initial_root_password

10、打开上面的配置地址:

bash 复制代码
http://xxx.xxx.xxx.xxx:6868

11、 修改后台语言:

12、关闭注册功能,账号只能由管理员添加创建,转到 http://xxx.xxx.xxx.xxx:6868/admin/application_settings/general,关闭 已启用注册功能,点击底下的 保存更改。

13、创建用户,转到 http://xxx.xxx.xxx.xxx:6868/admin/ ,点击用户,添加用户:

相关推荐
开开心心就好5 小时前
近200个工具的电脑故障修复合集
安全·智能手机·pdf·电脑·consul·memcache·1024程序员节
数据皮皮侠AI2 天前
中国城市可再生能源数据集(2005-2021)|顶刊 Sci Data 11 种能源面板
大数据·人工智能·笔记·能源·1024程序员节
计算机毕业论文辅导5 天前
物联网实战:基于MQTT协议的智能家居数据传输系统设计与实现
1024程序员节
开开心心就好5 天前
支持批量处理的视频分割工具推荐
安全·智能手机·rust·pdf·电脑·1024程序员节·lavarel
liuyao_xianhui7 天前
Linux开发工具结尾 _make
linux·运维·服务器·数据结构·哈希算法·宽度优先·1024程序员节
学传打活9 天前
【边打字.边学昆仑正义文化】_21_爱的结晶(1)
微信公众平台·1024程序员节·汉字·昆仑正义文化
数据皮皮侠AI16 天前
顶刊同款!中国地级市风灾风险与损失数据集(2000-2022)|灾害 / 环境 / 经济研究必备
大数据·人工智能·笔记·能源·1024程序员节
Fab1an17 天前
Busqueda——Hack The Box 靶机
linux·服务器·学习·1024程序员节
技术专家18 天前
Stable Diffusion系列的详细讨论 / Detailed Discussion of the Stable Diffusion Series
人工智能·python·算法·推荐算法·1024程序员节
学传打活20 天前
古代汉语是源,现代汉语是流,源与流一脉相承。
微信公众平台·1024程序员节·汉字·中华文化