Centos安装系列软件操作记录
安装GitLab(来源:开源中国)
1.打开防火墙的http和ssh访问
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
2.安装Postfix邮件通知
sudo yum install postfix sudo systemctl enable postfix sudo systemctl start postfix
出现报错,解决方式:
修改 /etc/postfix/main.cf的设置 inet_protocols = all inet_interfaces = all
3.执行安装gitlab,EXTERNAL_URL为服务器的IP,也可设置为域名。端口默认为80
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash sudo EXTERNAL_URL="ip" yum install -y gitlab-ee
/etc/gitlab/gitlab.rb 修改external_url,然后,刷新配置 sudo gitlab-ctl reconfigure
external_url 'http://XX.XX.XX.XX'
4.配置邮件服务器/etc/gitlab/gitlab.rb
配置发件人
gitlab_rails['gitlab_email_enabled'] = true gitlab_rails['gitlab_email_from'] = 'chenglitao@wangxiaobao.com' gitlab_rails['gitlab_email_display_name'] = 'Gitlab'
配置服务器
gitlab_rails['smtp_enable'] = true gitlab_rails['smtp_address'] = "smtp.XXX.com" gitlab_rails['smtp_port'] = 465 gitlab_rails['smtp_user_name'] = "XXX@XXX.com" gitlab_rails['smtp_password'] = "XX" gitlab_rails['smtp_domain'] = "XX.com" gitlab_rails['smtp_authentication'] = "login" gitlab_rails['smtp_enable_starttls_auto'] = true gitlab_rails['smtp_tls'] = true
sudo gitlab-ctl reconfigure,刷新配置
测试发送邮件
gitlab-rails console #进入控制台,然后发送邮件 Notify.test_email('593482670@qq.com', '邮件标题', '邮件正文').deliver_now
出现如下报错:OpenSSL::SSL::SSLError (hostname "smtp.wangxiaobao.com" does not match the server certificate)
解决办法:修改/etc/gitlab/gitlab.rb文件
gitlab_rails['smtp_openssl_verify_mode'] = 'none'
sudo gitlab-ctl reconfigure,重新测试。
5.登录
登陆external_url配置的地址,第一次打开需要设置密码,默认用户root,密码即为刚才设置的密码。
6.常用命令
//启动 sudo gitlab-ctl star //停止 sudo gitlab-ctl stop //重启 sudo gitlab-ctl restart //使更改配置生效 sudo gitlab-ctl reconfigure