Centos Linux 操作系统中配置Gitlab服务器

news/2024/11/23 2:41:20/

基本准备

安装常用的工具包

linux根据操作系统的不同,有不同的安装工具,如,

操作系统

格式

工具

Debian

.deb

apt, apt-cache, apt-get, dpkg

Ubuntu

.deb

apt, apt-cache, apt-get, dpkg

CentOS

.rpm

yum

Fedora

.rpm

dnf

FreeBSD

Ports, .txz

make, pkg

所以在Centos操作系统中,需要使用到的安装命令是yum。

Gitlab版本

一般我们使用CE版:gitlab community edition

版本参考:

Choose your GitLab distributionFind out the differences between the GitLab Enterprise and GitLab Community distributions so you can decide which may suit you best. Learn more!https://about.gitlab.com/install/ce-or-ee/

选择“Install Gitlab Community Edition”,然后,选择你的操作系统,这里,我用的Centos8,所以只能选择centos操作系统,官方的测试版本是Centos7,如下,

GitLab下载安装_GitLab最新中文免费版下载安装-极狐GitLab极狐GitLab中文官方网站提供GitLab最新中文版官方下载渠道,下载安装即可免费试用30天。Linux安装包已捆绑了运行极狐GitLab所需的所有服务与工具。https://about.gitlab.com/install/#centos-7

官方的安装说明有一大堆,实际上,只要做完第1,2,3点,就可以跑起来了,如下,

1. Install and configure the necessary dependencies

On CentOS 7 (and RedHat/Oracle/Scientific Linux 7), the commands below will also open HTTP, HTTPS and SSH access in the system firewall. This is an optional step, and you can skip it if you intend to access GitLab only from your local network.

sudo yum install -y curl policycoreutils-python openssh-server perl

# Enable OpenSSH server daemon if not enabled: sudo systemctl status sshd

sudo systemctl enable sshd

sudo systemctl start sshd

# Check if opening the firewall is needed with: sudo systemctl status firewalld

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

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

sudo systemctl reload firewalld

Next, install Postfix (or Sendmail) to send notification emails. If you want to use another solution to send emails please skip this step and configure an external SMTP server after GitLab has been installed.

sudo yum install postfix

sudo systemctl enable postfix

sudo systemctl start postfix

During Postfix installation a configuration screen may appear. Select 'Internet Site' and press enter. Use your server's external DNS for 'mail name' and press enter. If additional screens appear, continue to press enter to accept the defaults.

————————————————

碰到的问题(1):

原文链接:CentOS8 yum安装,出现:为仓库 ‘appstream‘ 下载元数据失败_Devinfo_CN的博客-CSDN博客

错误:为仓库'appstream'下载元数据失败 : Cannot prepare internal mirrorlist: No URLs in mirrorlist

原因为:21年12月停止服务后,CentOS 官方已从镜像中移除CentOS8的所有包。被转移到 https://vault.centos.org。可以在 /etc/yum.repos.d 中更新一下源。

可使用 vault.centos.org 代替 mirror.centos.org。

更新命令如下(2行命令,分别执行):

# sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-*

# sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*

然后再用yum安装包时,就能正常下载了

————————————————

碰到的问题(2):

未找到匹配的参数: policycoreutils-python

安装的时候只找到了policycoreutils,貌似也没什么影响。

2. Add the GitLab package repository and install the package

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash

==>

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

Next, install the GitLab package. Make sure you have correctly set up your DNS, and change 

https://gitlab.example.com

 to the URL at which you want to access your GitLab instance. Installation will automatically configure and start GitLab at that URL.

For 

https://

 URLs, GitLab will automatically request a certificate with Let's Encrypt, which requires inbound HTTP access and a valid hostname. You can also use your own certificate or just use 

http://

 (without the 

s

 ).

If you would like to specify a custom password for the initial administrator user ( 

root

 ), check the documentation. If a password is not specified, a random password will be automatically generated.

sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ee

EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ce

EXTERNAL_URL="http://gitlab.mysite.com" yum install -y gitlab-ce

3. Browse to the hostname and login

Unless you provided a custom password during installation, a password will be randomly generated and stored for 24 hours in 

/etc/gitlab/initial_root_password

 . Use this password with username 

root

 to login.

See our documentation for detailed instructions on installing and configuration.

这里,我通过cat指令直接看密码,然后拷贝出来用,

cat /etc/gitlab/initial_root_password

就可以看到密码,并进行初始登陆

通常,你只需要使用你的IP地址就可以了,至于那个EXTERN_URL域名,还没弄明白怎么用;因为我也不使用域名,所以也懒得去搭理了;如果想了解的话,到网上搜索一下,例如,

端口映射访问gitlab外部URL配置经验_gitlab external_url_atlasun的博客-CSDN博客

4. Set up your communication preferences

Visit our email subscription preference center to let us know when to communicate with you. We have an explicit email opt-in policy so you have complete control over what and how often we send you emails.

Twice a month, we send out the GitLab news you need to know, including new features, integrations, docs, and behind the scenes stories from our dev teams. For critical security updates related to bugs and system performance, sign up for our dedicated security newsletter.

Important note: If you do not opt-in to the security newsletter, you will not receive security alerts.

5. Recommended next steps

After completing your installation, consider the recommended next steps, including authentication options and sign-up restrictions.

TroubleshootingManual InstallationCE or EE

本文结束。


http://www.ppmy.cn/news/245157.html

相关文章

Sentinel-1(Resolution、Pixel Spacing)

目录 10m?还是20*22m? Resolution和Pixel Spacing 10m?还是20*22m? Sentinel-1 SAR GRD的分辨率为10m,基本上是常识了https://developers.google.com/earth-engine/datasets/catalog/COPERNICUS_S1_GRD#description…

springboot+vue游戏项目销售发行系统设计与实现

本游戏销售平台管理员功能有个人中心,用户管理,厂商管理,游戏类型管理,游戏信息管理,众筹项目管理,项目投资管理,论坛管理,管理员管理,系统管理等。厂商发布游戏&#xf…

CAD2006注册机不能显示激活码

原因:因为你的申请号不正确啊! 解决方法:改变申请号 Cad2006 如何改变申请号(一种简单的方法) 找到C:\Documents and Settings\All Users\Application Data\Autodesk\Software Licenses 删除里面的所有文件,应该是类似BXXXXXX.da…

cad2020直装版无需注册机

不负众望,众望所归,cad2022也正式推出了,更新了不少全新的功能,例如全新跨平台3D图形预览功能,可充分利用当今的GPU和多核处理器,还可以共享当前图纸,以便在AutoCAD Web应用程序中进行查看或编辑…

Office 2010注册机

偶然的机会得到了一个注册机,不知道是否对所有的2010版都管用,给大家分享一下,具体操作见附件说明,三步就搞定了。如果不能用也别说我,我的是可以的。

AutoCAD2004下载AutoCAD2004中文版安装教程

AutoCAD2004(32/64位)下载:https://pan.baidu.com/s/1n4u90xT_9B9rldhl_Atz_w 【下载方法】复制下载链接,粘贴纸浏览器网址栏(无提取码)打开,保存到网盘,打开网盘客户端,…

Autocad2017破解版下载|Autodesk Autocad 2017中文破解版下载 64位(附注册机/序列号)

Autocad2017是Autodesk公司开发的自动计算机辅助设计软件,可用于二维绘图、详细绘制、设计文档和基本三维设计,它具有良好的用户界面,允许用户通过交互菜单或命令行方式来进行各种操作,包括图形绘制、图形编辑、图形转换、对象捕捉等等,同时软件的多文档环境还可让非专业人…

AutoCAD 2010(让你的CAD都是正版)简体中文版注册机

AutoCAD 2010简体中文版的压缩包是ISZ格式,不能直接解压和安装,需要WinMount或UltraISO工具,虚拟盘符才能释放解压文件, 具体方法和步骤如下: 一、下载AutoCAD 2010简体中文版的.ISZ文件(1.43G&#xff09…