- 1 部署Gitlab
- 2 gitlab管理
// 关闭防火墙
[root@localhost ~]# systemctl stop --now firewalld
[root@localhost ~]# setenforce 0
[root@localhost ~]# sed -ri 's/^(SELINUX=).*/1disabled/g' /etc/sysconfig/selinux
// 下载repe源
[root@localhost ~]# yum -y install epel-release
//安装依赖包
[root@localhost ~]# yum -y install curl openssh-server openssh-clients postfix cronie policycoreutils-python-utils git
//启动postfix服务并设置开机自启
[root@localhost ~]# systemctl enable --now postfix
Created symlink /etc/systemd/system/multi-user.target.wants/postfix.service → /usr/lib/systemd/system/postfix.service.
// 下载gitlab的rpm包
路径 https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum
[root@localhost ~]# ls
anaconda-ks.cfg gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm
//安装gitlab
[root@localhost ~]# rpm -ivh gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm
[root@localhost ~]# rpm -ivh gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm
警告:gitlab-ce-14.3.2-ce.0.el8.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID f27eab47: NOKEY
Verifying... ################################# [100%]
准备中... ################################# [100%]
正在升级/安装...
1:gitlab-ce-14.3.2-ce.0.el8 ################################# [100%]
It looks like GitLab has not been configured yet; skipping the upgrade script.
*. *.
*** ***
***** *****
.****** *******
******** ********
,,,,,,,,,***********,,,,,,,,,
,,,,,,,,,,,*********,,,,,,,,,,,
.,,,,,,,,,,,*******,,,,,,,,,,,,
,,,,,,,,,*****,,,,,,,,,.
,,,,,,,****,,,,,,
.,,,***,,,,
,*,.
_______ __ __ __
/ ____(_) /_/ / ____ _/ /_
/ / __/ / __/ / / __ `/ __
/ /_/ / / /_/ /___/ /_/ / /_/ /
____/_/__/_____/__,_/_.___/
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
//修改配置文件
[root@localhost ~]# vim /etc/gitlab/gitlab.rb
external_url 'http://192.168.25.148' /将此处设为gitlab的服务器ip地址亦或域名
//重载配置文件并重启gitlab
[root@localhost ~]# gitlab-ctl reconfigure
[root@localhost ~]# gitlab-ctl restart
ok: run: alertmanager: (pid 6059) 0s
ok: run: gitaly: (pid 6069) 0s
ok: run: gitlab-exporter: (pid 6085) 0s
ok: run: gitlab-workhorse: (pid 6088) 0s
ok: run: grafana: (pid 6099) 0s
ok: run: logrotate: (pid 6116) 1s
ok: run: nginx: (pid 6122) 0s
ok: run: node-exporter: (pid 6130) 1s
ok: run: postgres-exporter: (pid 6136) 0s
ok: run: postgresql: (pid 6146) 1s
ok: run: prometheus: (pid 6157) 0s
ok: run: puma: (pid 6177) 0s
ok: run: redis: (pid 6182) 1s
ok: run: redis-exporter: (pid 6188) 0s
ok: run: sidekiq: (pid 6273) 0s
//查看当前的gitlab版本
[root@localhost ~]# head -1 /opt/gitlab/version-manifest.txt
gitlab-ce 14.3.2
//破解管理员密码
[root@localhost ~]# vim /etc/gitlab/initial_root_password
# WARNING: This value is valid only in the following conditions
# 1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).
# 2. Password hasn't been changed manually, either via UI or via command line.
#
# If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.
Password: ySZB0NeTyAbfZUNfy0mcdYnYuTzvtiZjIRckDGl/6tc= //将此密码设置为你自己想设置的密码
2 gitlab管理
在浏览器中使用gitlab服务器的ip访问
主页
管理页面



