CentOS7.2安装gitlab

本文介绍了GitLab的安装与配置方法。包括安装并配置必要依赖、安装Postfix、添加下载镜像源、修改配置、配置nginx等步骤,还给出了Postfix报错的解决办法,同时说明了缺省安装后的重要信息,如程序目录、文件数据目录等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

中文官网:https://www.gitlab.com.cn/installation

参考网站:https://www.aliyun.com/jiaocheng/128071.html

要求分配给gitlab的运行内存至少为2G

一.安装并配置必要的依赖关系
sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
二.安装Postfix
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
若出现以下报错:
Job for postfix.service failed because the control process exited with error code. See "systemctl status postfix.service" and "journalctl -xe" for details.
解决方法:
vim /etc/hosts
::1 localhost.localdomain localhost  #将此行注释掉
::1 localhost6.localdomain6 localhost6   #将此行注释掉


三.添加下载镜像源
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash


修改相应域名(后期访问gitlab)
sudo EXTERNAL_URL="http://gitlab.idoukou.com" yum install -y gitlab-ee


四.修改配置
修改 gitlab 配置
官方安装方式下,配置文件是/etc/gitlab/gitlab.rb
gitlab nginx 端口监听修改:nginx['listen_port'] = 端口号
gitlab 的域名:external_url '域名'
修改完上述参数 执行命令 sudo gitlab-ctl reconfigure
任何修改过的配置文件,都需要执行:gitlab-ctrl reconfigure
启动停止:sudo gitlab-ctl start | stop |restart | status


五.配置nginx
官方安装方式下,配置文件是/opt/gitlab/embedded/conf/nginx.conf
修改完配置,重启:gitlab-ctrl reconfigure
访问地址:http://x.x.x.x   默认用户:root 

缺省安装后的一些重要信息
程序目录在:/opt/gitlab
文件数据在:/var/opt/gitlab
git repo目录在:/var/opt/gitlab/git-data
nginx配置目录:/var/opt/gitlab/nginx/conf/gitlab-http.conf
上传图片目录在:/var/opt/gitlab/uploads
使用的本地模式运行的postgresql数据,会随gitlab启动时候自动运行
使用本地运行的redis服务,会随gitlab启动时候自动运行
缺省利用本地邮局,自动投递给其他服务器,如果是非互联网ip,可以修改为本地smtp方式
修改ssh服务的git账号入口,git账号的登录shell处理为gitlab-shell
自带nginx,缺省会在所有ip地址的80端口监听请求,请求会转发给ruby进程
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值