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/ ,点击用户,添加用户:

相关推荐
开开心心就好10 天前
内存清理软件灵活设置,自动阈值快捷键清
运维·服务器·windows·pdf·harmonyos·risc-v·1024程序员节
学传打活11 天前
【边打字.边学昆仑正义文化】_5_宇宙物种创造简史(1)
微信公众平台·1024程序员节·汉字·昆伦正义文化
xcLeigh12 天前
打破机房围墙:VMware+cpolar构建跨网络虚拟实验室
vmware·内网穿透·cpolar·实验室·远程访问·1024程序员节
开开心心就好14 天前
免费轻量电子书阅读器,多系统记笔记听书
linux·运维·服务器·安全·ddos·可信计算技术·1024程序员节
unable code15 天前
流量包取证-大流量分析
网络安全·ctf·misc·1024程序员节·流量包取证
开开心心就好15 天前
实用PDF擦除隐藏信息工具,空白处理需留意
运维·服务器·windows·pdf·迭代器模式·桥接模式·1024程序员节
unable code16 天前
浏览器取证-[GKCTF 2021]FireFox Forensics
网络安全·ctf·misc·1024程序员节·浏览器取证
unable code16 天前
内存取证-[安洵杯 2019]Attack
网络安全·ctf·misc·1024程序员节·内存取证
unable code16 天前
CTF-SPCS-Forensics
网络安全·ctf·misc·1024程序员节·取证