Centos7.9安装GitLab
1、下载
Index of /gitlab-ce/yum/el7/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
下载最新版本gitlab-ce-15.4.2-ce.0.el7.x86_64
2、安装基础依赖并启动
#安装依赖
yum install -y curl policycoreutils-python openssh-server postfix
#配置开机启动
systemctl enable sshd
systemctl enable postfix
#启动ssh和postfix
systemctl start sshd
systemctl start postfix
3、安装gitlab
rpm -ivh gitlab-ce-15.4.2-ce.0.el7.x86_64.rpm
默认安装路径为 /opt/gitlab/,程序数据及配置文件保存路径为/var/opt/gitlab,下面是gitlab重要的组件的目录:
代码仓库保存位置:/var/opt/gitlab/git-data/repositories/
代码仓库备份位置:/var/opt/gitlab/backups/
postgresql数据及配置目录:/var/opt/gitlab/postgresql/data/
redis默认配置目录:/var/opt/gitlab/redis
gitlab主要配置文件:/etc/gitlab/gitlab.rb
4、修改配置文件
vim /etc/gitlab/gitlab.rb
external_url 'http://192.168.47.135:8088'
gitlab_rails['time_zone'] = 'Asia/Shanghai'
#邮件配置
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = 'smtp.exmail.qq.com'
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = 'yourmail@qq.com'
gitlab_rails['smtp_password'] = 'yourpasswd'
gitlab_rails['smtp_domain'] = 'exmail.qq.com'
gitlab_rails['smtp_authentication'] = 'login'
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = 'yourmail@qq.com'
gitlab_rails['gitlab_email_display_name'] = 'Gitlab'
#禁用用户组
gitlab_rails['gitlab_default_can_create_group'] = false
修改完成之后执行:gitlab-ctl reconfigure
第一次执行的时间比较长
#其他常用命令
sudo gitlab-ctl start
sudo gitlab-ctl stop
sudo gitlab-ctl restart
5、开放防火墙
sudo firewall-cmd --zone=public --add-port=8088/tcp --permanent && sudo firewall-cmd --reload
6、访问web页面
————————————————
版权声明:本文为CSDN博主「BYAPESS」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Bzbtyhydcxy/article/details/129020676