当前位置: 首页 > Linux

centos下搭建gitlab

时间:2023-04-06 04:05:07 Linux

说明:本文根据原文链接整理环境。阿里云主机centos7.6x86_642核心cpu/4g内存搭建步骤修改yum源为阿里云源:sudoyuminstall-ycurlwgetmv/etc/yum.repos.d/CentOS-Base。回购/etc/yum.repos.d/CentOS-Base.repo.backupwget-O/etc/yum.repos.d/CentOS-Base.repohttp://mirrors.aliyun.com/repo/Centos-7.repowget-O/etc/yum.repos.d/epel.repohttp://mirrors.aliyun.com/repo/epel-7.repoyumcleanallyummakecache安装依赖:sudoyuminstall-ypolicycoreutils-pythonopenssh-serversshbootsfrom启动:sudosystemctlenablesshdssh启动:sudosystemctlstartsshdpostfix安装:sudoyuminstall-ypostfixPostfix开机:sudosystemctlenablepostfix修改postfix配置:vim/etc/postfix/main.cf找到,inet_interfaces=localhost,更改保存并退出inet_interfaces=all,:wq,postfixstart:sudosystemctlstartpostfixaddgitlabpackagerepository:curlhttps://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh|sudo用bash安装gitlab:sudoEXTERNAL_URL="你的Gitlab服务器运行的公网IP地址"yuminstall-ygitlab-ce查看gitlab的运行状态:gitlab-ctlstatus查看所有服务是否正常运行访问gitlab地址:http://你的Gitlab服务器服务器运行的公网IP地址,会出现gitlab界面,如图:备注:只有centos7支持systemctl命令。1核cpu+2g内存的服务器无法驱动gitlab,安装时会报分配给gitlab的内存不足。常用:查看状态:gitlab-ctlstatus查看日志:gitlab-ctltail配置文件:/etc/gitlab/gitlab.rb安装目录:/opt/gitlab日志目录:/var/log/gitlabgitlab打包安装自带服务:nginx/redis/postgres/rubyonrails/unicorn参考链接gitlabbuild原文链接postfixinstalledbutcannotreceiveemail解决方法gitlab迁移