首页 > 其他分享 >GitLab安装使用

GitLab安装使用

时间:2024-12-13 19:09:16浏览次数:5  
标签:systemd GitLab ## 安装 gitlab firewalld selinux 使用 root

GitLab的安装

1. 环境配置

关闭防火墙和selinux

[root@gitlab ~]# systemctl stop firewalld
[root@gitlab ~]# systemctl disable firewalld
Removed "/etc/systemd/system/multi-user.target.wants/firewalld.service".
Removed "/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service".
[root@gitlab ~]# systemctl status firewalld
○ firewalld.service - firewalld - dynamic firewall daemon
     Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; prese>
     Active: inactive (dead)
       Docs: man:firewalld(1)

Dec 12 23:01:50 study systemd[1]: Starting firewalld - dynamic firewall daemon.>
Dec 12 23:01:51 study systemd[1]: Started firewalld - dynamic firewall daemon.
Dec 12 23:40:35 gitlab systemd[1]: Stopping firewalld - dynamic firewall daemon>
Dec 12 23:40:35 gitlab systemd[1]: firewalld.service: Deactivated successfully.
Dec 12 23:40:35 gitlab systemd[1]: Stopped firewalld - dynamic firewall daemon.
[root@gitlab ~]# getenforce
Enforcing
[root@gitlab ~]# vim /etc/selinux/config
[root@gitlab ~]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
# See also:
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/using_selinux/changing-selinux-states-and-modes_using-selinux#changing-selinux-modes-at-boot-time_changing-selinux-states-and-modes
#
# NOTE: Up to RHEL 8 release included, SELINUX=disabled would also
# fully disable SELinux during boot. If you need a system with SELinux
# fully disabled instead of SELinux running with no policy loaded, you
# need to pass selinux=0 to the kernel command line. You can use grubby
# to persistently set the bootloader to boot with selinux=0:
#
#    grubby --update-kernel ALL --args selinux=0
#
# To revert back to SELinux enabled:
#
#    grubby --update-kernel ALL --remove-args selinux
#
SELINUX=disabled
# SELINUXTYPE= can take one of these three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted


[root@gitlab ~]# setenfore 0


2. 部署Gitlab

2.1 安装gitlab依赖包


[root@gitlab ~]# yum install -y curl openssh-server openssh-clients  postfix cronie python3-policycoreutils

2.2 添加yum源

[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1


2.3 安装gitlab

yum makecache
yum install gitlab-ce

3. 配置Gitlab

3.1设置登录链接

##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
##!
##! Note: During installation/upgrades, the value of the environment variable
##! EXTERNAL_URL will be used to populate/replace this value.
##! On AWS EC2 instances, we also attempt to fetch the public hostname/IP
##! address from AWS. For more details, see:
##! https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
external_url 'http://192.168.100.31'


3.2 初始化gitlab

[root@gitlab ~]# gitlab-ctl reconfigure
Notes:
Default admin account has been configured with following details:
Username: root
Password: You didn't opt-in to print initial root password to STDOUT.
Password stored to /etc/gitlab/initial_root_password. This file will be cleaned up in first reconfigure run after 24 hours.

NOTE: Because these credentials might be present in your log files in plain text, it is highly recommended to reset the password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.

gitlab Reconfigured!


3.3 gitlab使用

3.3.1 修改管理员用户密码

[root@gitlab ~]# gitlab-rails console -e production
--------------------------------------------------------------------------------
 Ruby:         ruby 3.2.5 (2024-07-26 revision 31d0f1a2e7) [x86_64-linux]
 GitLab:       17.6.2 (58dfc9c873e) FOSS
 GitLab Shell: 14.39.0
 PostgreSQL:   14.11
------------------------------------------------------------[ booted in 35.55s ]
Loading production environment (Rails 7.0.8.4)
irb(main):001:0> user = User.where(id: 1).first
=> #<User id:1 @root>
irb(main):002:0> user.password = 'Risikyou'
=> "Risikyou"
irb(main):003:0> user.save!
=> true
irb(main):004:0> exit
[root@gitlab ~]#



输入IP回车,创建用户或者登录

alt text

标签:systemd,GitLab,##,安装,gitlab,firewalld,selinux,使用,root
From: https://www.cnblogs.com/shiqiang-lee/p/18605645

相关文章

  • Spring Boot教程之二十五: 使用 Tomcat 部署项目
    SpringBoot–使用Tomcat部署项目SpringBoot是一个基于微服务的框架,在其中创建可用于生产的应用程序只需很少的时间。SpringBoot建立在Spring之上,包含Spring的所有功能。如今,它正成为开发人员的最爱,因为它是一个快速可用于生产的环境,使开发人员能够直接专注于逻辑......
  • 管理型交换机第一次使用体验
    课题如下图,需要实现的功能如下:2个交换机的2/3/4口分别对应一个PC和一个设备,要求2<->2/3<->3/4<->4完全对应,不同口之间不允许交叉访问。2个交换机之间不直连,每个交换机的1口对应一个可以做WDS无线桥接的无线路由器,1口允许1/2/3/4口的所有数据流出/流入。2个交换机的5/6/7口作......
  • Redis 安装
    Windows上安装RedisWindows上安装Redis可以使用Redis社区编译好的Redis安装包RedisWindows下载地址:https://github.com/MicrosoftArchive/redis/releases这个版本会落后于Redis官方版本,但不影响使用Redis支持32位和64位,这个需要根据你系统平台的实际情况......
  • qgis的安装
    QGIS3.34的环境配置2024.11.23现在的长期支持版本是3.34,QGIS是免费开源的有两种下载方式:独立安装程序OSGeo4W安装程序(网络安装)我选择的是OSGeo4W安装程序(网络安装)(这个好像更麻烦,想快点的去下独立安装包)下载安装包点击安装这里是存安装包的地方,用完可以删除选择......
  • QT windows下使用CMake,设置步骤 mingw lvgl编译运行
    参考https://blog.csdn.net/qq_33963083/article/details/95920238针对我安装的qt,目录如下然后用qtcreate打开打开项目中的CMakeLists.txt可以使用的项目如下gitclone--recursivehttps://github.com/Sanya-123/lvgl_port_qt.git......
  • 使用ComfyUI下Flux Fill+Redux实现电商换装效果,电商必备工作流
    前段时间黑森林实验室发布的Flux-Tools虽然做了分享,但是一直没有仔细试一下。正好,今天有点时间,也换换脑子,一直做技术分享了,今天休闲一下,测试一下Flux-Fill+Flux-Redux的换装效果。先看完整工作流,如下:【环境采用的是Liblib】有需要comfyui整合包以及工作流,可以扫描下方,免......
  • kylin桌面系统安装rabbitvcs
    kylin桌面系统和服务器版不同,它是基于ubuntu的,所以在安装上大概按照ubuntu安装就行。但kylin桌面系统,的文件管理是peony,而非nautilus,所以安装成功后,右键菜单不显示。1、安装aptinstallsubversionaptinstallrabbitvcs-nautilus2、问题处理 当shell中输入nauti......
  • 【ROS机器人入门】ROS的安装和更新,学不会头提给你
    打开官网www.ros.org,或者直接登录http://wiki.ros.org/noetic/Installation/Ubuntu进行所有操作前,先更新终端输入:sudoapt-getupdate终端输入:sudoapt-getupgrade 1.1ConfigureyourUbunturepositories 这一步配置ubuntu的软件仓库,一般在不熟悉的时候不动1......
  • [VSCode] vscode下载安装及安装中文插件详解(附下载文件)
      前言vscode链接:https://pan.quark.cn/s/3acbb8aed758提取码:dSytVSCode是一款由微软开发且跨平台的免费源代码编辑器;该软件支持语法高亮、代码自动补全、代码重构、查看定义功能,并且内置了命令行工具和Git版本控制系统。通过上面的连接下载得到压缩包,解压得到exe......
  • 51.MongoDB的使用
      (五十一)MongoDB的使用1:MongoDB 概念   MongoDB的库中由一个或多个collections组成,这里的collection相当与关系型数据库中的表MongoDB中的记录是一个document文档,它是由字段和值对组成的数据结构。MongoDB文档类似于JSON对象。字段的值可以包......