系统:CentOS7.5X64
下载gitlab 最新版
https://packages.gitlab.com/gitlab/gitlab-ce/
3.2:安装环境初始化
yum install curl policycoreutils openssh-server openssh-clients postfix -y
默认,使用 Postfix 发送邮件
service postfix start
chkconfig postfix on
iptables -F #清空规则
systemctl stop firewalld
systemctl disable firewalld
3.3 安装gitlab-ce
官方地址下载比较慢,可以用清华的镜像库Index of /gitlab-ce/yum/el6/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-11.0.3-ce.0.el7.x86_64.rpm/download.rpm
rpm -ivh gitlab-ce-11.0.3-ce.0.el7.x86_64.rpm
3.4 配置并启动GitLab
gitlab-ctl reconfigure #重新配置应用程序。相当于初始化一下
gitlab-ctl status
Gitlab安装后初始密码在 /etc/gitlab/initial_root_password
netstat -nultp |grep :80
vim /etc/gitlab/gitlab.rb
external_url 'http://gitlab.example.com' //你的ip
gitlab_rails['gitlab_ssh_host'] = 'ip' //你的ip
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.qq.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "826233086@qq.com"
gitlab_rails['smtp_password'] = "password"
gitlab_rails['smtp_domain'] = "smtp.qq.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['smtp_pool'] = false
###! **Can be: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert'**
###! Docs: http://api.rubyonrails.org/classes/ActionMailer/Base.html
# gitlab_rails['smtp_openssl_verify_mode'] = 'none'
# gitlab_rails['smtp_ca_path'] = "/etc/ssl/certs"
# gitlab_rails['smtp_ca_file'] = "/etc/ssl/certs/ca-certificates.crt"
### Email Settings
# gitlab_rails['gitlab_email_enabled'] = true
##! If your SMTP server does not like the default 'From: gitlab@gitlab.example.com'
##! can change the 'From' with this setting.
gitlab_rails['gitlab_email_from'] = '826233086@qq.com'
gitlab_rails['gitlab_email_display_name'] = 'tianbaoyin'
验证邮箱
#进入gitlab
gitlab-rails console
#发送测试文件
Notify.test_email('826233086@qq.com','gitlab','欢迎使用Gitlab').deliver_now
修改IP地址
vim /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
## GitLab settings
gitlab:
## Web server settings (note: host is the FQDN, do not include http://)
host: localhost >> 这里改为主机的IP即可
port: 80
https: false
# Uncommment this line below if your ssh host is different from HTTP/HTTPS one
# (you'd obviously need to replace ssh.host_example.com with your own host).
# Otherwise, ssh host will be set to the `host:` value above
gitlab的管理
关闭gitlab: # gitlab-ctl stop
启动gitlab: # gitlab-ctl start
重启gitlab: # gitlab-ctl restart
文章参考gitlab 的介绍与安装配置(一)_flyfish的技术博客_51CTO博客_gitlab安装配置