centos 7 安装 gitlab
实验环境 centos 7.7 6G 4核
centos 源:wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
EPEL 源: wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
[[email protected] ~]# yum makecache
[[email protected] ~]# systemctl stop firewalld && systemc disable firewalld
[[email protected] ~]# setenforce 0
[[email protected] ~]# cat /etc/selinux/config
…
SELINUX=disabled
…
- 安装依赖组件
[[email protected] ~]# yum install curl policycoreutils openssh-server openssh-clients -y
[[email protected] ~]# systemctl enable postfix
[[email protected] ~]# systemctl start postfix
[[email protected] yum.repos.d]# vim gitlab_gitlab-ce.repo
[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key
[[email protected] yum.repos.d]# yum install gitlab-ce -y
安装有点慢
[[email protected] ~]# vim /etc/gitlab/gitlab.rb
29# external_url ‘http://gitlab.example.com’
29 external_url ‘http://10.60.11.110’
617 gitlab_rails[‘smtp_enable’] = true
618 gitlab_rails[‘smtp_address’] = “[email protected]”
619 gitlab_rails[‘smtp_port’] = 465
620 gitlab_rails[‘smtp_user_name’] = “x[email protected]”
621 gitlab_rails[‘smtp_password’] = “smtp授权码”
622 gitlab_rails[‘smtp_domain’] = “qq.com”
623 gitlab_rails[‘smtp_authentication’] = “login”
624 gitlab_rails[‘smtp_enable_starttls_auto’] = true
625 gitlab_rails[‘smtp_tls’] = true
626 user[‘git_user_email’] = “[email protected]”
627 gitlab_rails[‘gitlab_email_from’] = ‘[email protected]’
[[email protected] ~]# gitlab-ctl reconfigure
漫长的等待
[[email protected] ~]# gitlab-ctl status
浏览器访问http://10.60.11.110
设置root 密码 不少于8位
登录
管理 gitlab
关闭 gitlab: # gitlab-ctl stop
启劢 gitlab: # gitlab-ctl start
重启 gitlab: # gitlab-ctl restart
gitlab 主配置文件:/etc/gitlab/gitlab.rb //可以自定义一些邮件服务等
日志地址:/var/log/gitlab/ // 对应各服务
服务地址:/var/opt/gitlab/ // 对应各服务的主目录
仓库地址:/var/opt/gitlab/git-data //记录项目仓库等提交信息
重置配置:gitlab-ctl reconfigure //丌要乱用,会重置为最原始的配置的
重启服务:gitlab-ctl stop/start/restart //启劢命令