龚哥哥 爱生活、做自己!
CentOS_6.5安装GitLab_7.51
发表于 2015-9-1 | 服务器

一、把所有包升级到最新版本+rpm包安装

yum -y upgrade

如果网速不好,可以在360云盘下载

http://yunpan.cn/cVfDfDSvuZUff (提取码:a6c7)

curl -O https://downloads-packages.s3.amazonaws.com/centos-6.6/gitlab-7.5.1_omnibus.5.2.0.ci-1.el6.x86_64.rpm
sudo yum install openssh-server
sudo yum install postfix
sudo yum install cronie
sudo service postfix start
sudo chkconfig postfix on
sudo rpm -ivh gitlab-7.5.1_omnibus.5.2.0.ci-1.el6.x86_64.rpm

二、修改配置文件 (sudo gitlab-ctl reconfigure前需要配置的)

vim /etc/gitlab/gitlab.rb
external_url 'hostname'  ->  将其修改为  -> external_url='hostname'
如:external_url = 'www.gongfuxiang.com'

三、重置配置和启动 GitLab

sudo gitlab-ctl reconfigure
sudo lokkit -s http -s ssh

四、修改访问域名和项目域名

1;web端(gitlab-rails)
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: www.gongfuxiang.com
    port: 80
    https: false

2;git-shell的
vim /opt/gitlab/embedded/service/gitlab-shell/config.yml
gitlab_url: "http://www.gongfuxiang.com"

五、邮件配置(用户注册的时候使用)

vim /opt/gitlab/embedded/service/gitlab-rails/config/environments/production.rb

在  # config.action_mailer.delivery_method = :sendmail 下加入、# 表示注释。
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.smtp_settings = {
  :address              => "smtp.163.com",
  :port                 => 587,
  :domain               => 'username@163.com',
  :user_name            => 'username@163.com',
  :password             => 'password',
  :authentication       =>  :plain,
  :enable_starttls_auto => true
}

修改显示的邮箱,打开以下文件,找到指定位置,修改即可
vim /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
# Email address used in the "From" field in mails sent by GitLab
 email_from: username@163.com
 # Email address of your support contact (default: same as email_from)
 support_email: username@163.com

六、gitlab服务开启+重启

gitlab-ctl stop停止
gitlab-ctl start 开启
gitlab-ctl restart重启

安装完成

访问 http://www.gongfuxiang.com

管理员: root

初始密码: 5iveL!fe

发表评论:

TOP