Centos6.4安装Gitlib

安装Ruby

安装依赖

$ sudo yum -y upgrade
$ sudo yum groupinstall "Development tools"
$ sudo yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mysql-devel libffi-devel

下载Ruby2.2.0并卸载原来的Ruby

$ wget http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.0.tar.gz
$ tar -zxvf ruby-2.2.0.tar.gz
$ yum erase ruby ruby-libs ruby-mode ruby-rdoc ruby-irb ruby-ri ruby-docs

编译安装

$ ./configure
$ make
$ sudo make install

如果编译时候提示

make[2]: *** [../../.ext/x86_64-linux/fiddle.so] Error 1
make[2]: Leaving directory `/home/simowce/ruby-2.2.0/ext/fiddle'
make[1]: *** [ext/fiddle/all] Error 2
make[1]: Leaving directory `/home/simowce/ruby-2.2.0'
make: *** [build-ext] Error 2

安装libfii

$ sudo yum install libfii libfii-devel

如果安装的时候提示

Directory .ext/rdoc already exists, but it looks like it isn't an RDoc directory.

Because RDoc doesn't want to risk destroying any of your existing files,
you'll need to specify a different output directory name (using the --op
option)

则在configure的时候带上参数,不安装rdoc

$ ./configure --disable-install-rdoc

安装Gitlib

$ sudo yum install openssh-server
$ sudo yum install postfix
$ sudo yum install cronie
$ sudo service postfix start
$ sudo chkconfig postfix on
$ sudo lokkit -s http -s ssh
$ curl -O https://downloads-packages.s3.amazonaws.com/centos-6.6/gitlab-7.8.0_omnibus-1.el6.x86_64.rpm
$ sudo rpm -i gitlab-7.8.0_omnibus-1.el6.x86_64.rpm

启动postfix失败

查看/etc/log/mailog发现如下错误:

postfix[21727]: fatal: parameter inet_interfaces: no local interface found for ::1

修改/etc/postfix/main.cf:

inet_interfaces = 127.0.0.1 #只能接受内部邮件,其它邮件不接受

inet_protocols = all

使用apache替换自带ngnix

Use Apache instead of built-in Nginx in GitLab CE

使用myqsl数据库

参数修改:https://lessmind.github.io/2016/11/18/gitlab-ce-omnibus-package-with-mysql/

安装mysql2的时候 版本选择 v0.3.18, 否则其他版本好像会有问题

迁移原来postgresql到mysql: http://www.nexisonline.net/index.php/2015/07/18/migrating-gitlab-from-postgresql-to-mysqlmariadb/