centos 6.4/redhat 6.4 安装gitlab

一,把所有包升级到最新版本

yum -y upgrade


二,安装最新版ruby 2.1.5 

步骤http://my.oschina.net/duolus/blog/348353


三,安装官方给出的omnibus软件包(下面是官方给出的安装步骤,安装之)

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 -i gitlab-7.5.1_omnibus.5.2.0.ci-1.el6.x86_64.rpm


四,重置配置和启动 GitLab

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


五,浏览器输入服务器ip登录
Username: root 
Password: 5iveL!fe


===========================


可能遇到的问题  (不定期更新)


  1. gitlab-ctl reconfigure 报错解决方法

[root@websvr01 ~]# sudo gitlab-ctl reconfigure
Starting Chef Client, version 11.12.2
Compiling Cookbooks...
Recipe: gitlab::default
  * directory[/etc/gitlab] action create (up to date)
================================================================================
Recipe Compile Error in /opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb
================================================================================
RuntimeError
------------
External URL must include a FQDN
Cookbook Trace:
---------------
  /opt/gitlab/embedded/cookbooks/gitlab/libraries/gitlab.rb:109:in `parse_external_url'
  /opt/gitlab/embedded/cookbooks/gitlab/libraries/gitlab.rb:260:in `generate_config'
  /opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb:34:in `from_file'
Relevant File Content:
----------------------
/opt/gitlab/embedded/cookbooks/gitlab/libraries/gitlab.rb:
102:  
103:      def parse_external_url
104:        return unless external_url
105:  
106:        uri = URI(external_url.to_s)
107:  
108:        unless uri.host
109>>         raise "External URL must include a FQDN"
110:        end
111:        Gitlab['user']['git_user_email'] ||= "gitlab@#{uri.host}"
112:        Gitlab['gitlab_rails']['gitlab_host'] = uri.host
113:        Gitlab['gitlab_rails']['gitlab_email_from'] ||= "gitlab@#{uri.host}"
114:  
115:        case uri.scheme
116:        when "http"
117:          Gitlab['gitlab_rails']['gitlab_https'] = false
118:        when "https"
Running handlers:
[2014-11-25T11:10:44+08:00] ERROR: Running exception handlers
Running handlers complete
[2014-11-25T11:10:44+08:00] ERROR: Exception handlers complete
[2014-11-25T11:10:44+08:00] FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated in 7.716937465 seconds
[2014-11-25T11:10:44+08:00] ERROR: External URL must include a FQDN
[2014-11-25T11:10:45+08:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

解决方法:

是因为/etc/gitlab/gitlab.rb文件中的内容是:

external_url 'hostname'

将其修改为:

external_url='hostname'

即可,只需要在原来的配置项中添加个 ‘=’ 即可,为了避免域名引起的问题,也可以直接配置ip,如下所示:

external_url='192.168.1.49'。
















你可能感兴趣的:(centos 6.4/redhat 6.4 安装gitlab)