centos 6.4x64 安装gitlab

gitlab是一个使用 Ruby on Rails 开发的开源应用程序,与Github类似,能够浏览源代码,管理缺陷和注释,非常适合在团队内部使用。

一、环境

系统:CentOS 6.4x64最小化安装

IP:192.168.3.71

二、安装yum源

安装epel源

[[email protected] ~]# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Retrieving http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
warning: /var/tmp/rpm-tmp.yZsZfC: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing...                ########################################### [100%]
   1:epel-release           ########################################### [100%]
#编辑/etc/yum.repos.d/epel.repo文件
[[email protected] ~]# vim /etc/yum.repos.d/epel.repo 
#将mirroelist注释,开启baseurl
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

安装阿里云开源镜像

[[email protected] ~]#  wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

三、安装基础依赖包

[[email protected] ~]# yum -y update
[[email protected] ~]# yum -y groupinstall ‘Development Tools‘
[[email protected] ~]# yum -y install readline readline-devel ncurses-devel gdbm-devel glibc-devel tcl-devel openssl-devel curl-devel expat-devel db4-devel byacc sqlite-devel libyaml libyaml-devel libffi libffi-devel libxml2 libxml2-devel libxslt libxslt-devel libicu libicu-devel system-config-firewall-tui redis sudo wget crontabs logwatch logrotate perl-Time-HiRes git cmake libcom_err-devel.i686 libcom_err-devel.x86_64

四、安装git

查看默认安装的git版本

[[email protected] ~]# git --version
git version 1.7.1

先删除然后下载源码进行安装,下载地址https://www.kernel.org/pub/software/scm/git/,这里我们选择git-2.3.5版本的

[[email protected] ~]# yum remove git -y
[[email protected] ~]# wget 
[[email protected] ~]# tar xf git-2.3.5.tar.gz 
[[email protected] ~]# cd git-2.3.5 
[[email protected] git-2.3.5]# ./configure 
[[email protected] git-2.3.5]# make && make prefix=/usr/local install
#安装过程中出现如下错误
Can‘t locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 3.
BEGIN failed--compilation aborted at Makefile.PL line 3.
make[1]: *** [perl.mak] Error 2
make: *** [perl/perl.mak] Error 2

#解决如下
[[email protected] git-2.3.5]# yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker -y

#重新make
[[email protected] git-2.3.5]# make && make prefix=/usr/local install
[[email protected] git-2.3.5]# ln -s /usr/local/bin/git /usr/bin/git

安装完成后验证结果

[[email protected] git-2.3.5]# which git
/usr/local/bin/git
[[email protected] git-2.3.5]# git --version
git version 2.3.5

五、安装ruby环境

下载软件安装包,并安装

[[email protected] ~]# wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-2.1.5.tar.gz
[[email protected] ~]# tar xf ruby-2.1.5.tar.gz 
[[email protected] ~]# cd ruby-2.1.5
[[email protected] ruby-2.1.5]# ./configure --disable-install-rdoc
[[email protected] ruby-2.1.5]# make && make prefix=/usr/local install

安装bundler

#设置ruby gem源为淘宝
[[email protected] ruby-2.1.5]#  gem source -r https://rubygems.org/
https://rubygems.org/ removed from sources
[[email protected] ruby-2.1.5]# gem source -a http://ruby.taobao.org/
http://ruby.taobao.org/ added to sources

#安装bundler
[[email protected] ruby-2.1.5]# gem install bundler --no-doc
Fetching: bundler-1.9.6.gem (100%)
Successfully installed bundler-1.9.6
1 gem installed

验证安装后的结果

[[email protected] ruby-2.1.5]# which ruby
/usr/local/bin/ruby
[[email protected] ruby-2.1.5]# ruby --version
ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]

六、创建系统用户

[[email protected] ~]# useradd --comment ‘Gitlab‘ git
[[email protected] ~]# echo "git ALL=(ALL)   NOPASSWD: ALL" >>/etc/sudoers

七、安装mysql-5.5-37

这里使用源码进行安装,使用的是安装脚本。脚本内容如下

#!/bin/bash

DATADIR=‘/data/mysql/data‘
VERSION=‘mysql-5.5.37‘
export LANG=zh_CN.UTF-8

#Source function library.
. /etc/init.d/functions

#camke install mysql5.5.X
install_mysql(){
        read -p "please input a password for root: " PASSWD
        if [ ! -d $DATADIR ];then
                mkdir -p $DATADIR
        fi
        yum install cmake make gcc-c++ bison-devel ncurses-devel -y
        id mysql &>/dev/null
        if [ $? -ne 0 ];then
                useradd mysql -s /sbin/nologin -M
        fi
        #useradd mysql -s /sbin/nologin -M
        #change datadir owner to mysql
        chown -R mysql.mysql $DATADIR
        cd
        #wget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.38.tar.gz
        tar xf $VERSION.tar.gz
        cd $VERSION
        cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/$VERSION         -DMYSQL_DATADIR=$DATADIR         -DMYSQL_UNIX_ADDR=$DATADIR/mysql.sock         -DDEFAULT_CHARSET=utf8         -DDEFAULT_COLLATION=utf8_general_ci         -DENABLED_LOCAL_INFILE=ON         -DWITH_INNOBASE_STORAGE_ENGINE=1         -DWITH_FEDERATED_STORAGE_ENGINE=1         -DWITH_BLACKHOLE_STORAGE_ENGINE=1         -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1         -DWITHOUT_PARTITION_STORAGE_ENGINE=1
        make && make install
        if [ $? -ne 0 ];then
                action "install mysql is failed!"  /bin/false
                exit $?
        fi
        sleep 2
        #link
        ln -s /usr/local/$VERSION/ /usr/local/mysql
        ln -s /usr/local/mysql/bin/* /usr/bin/
        #copy config and start file
        /bin/cp /usr/local/mysql/support-files/my-small.cnf /etc/my.cnf
        cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
        chmod 700 /etc/init.d/mysqld
        #init mysql
        /usr/local/mysql/scripts/mysql_install_db  --basedir=/usr/local/mysql --datadir=$DATADIR --user=mysql
        if [ $? -ne 0 ];then
                action "install mysql is failed!"  /bin/false
                exit $?
        fi
        #check mysql
        /etc/init.d/mysqld start
        if [ $? -ne 0 ];then
                action "mysql start is failed!"  /bin/false
                exit $?
        fi
        chkconfig --add mysqld
        chkconfig mysqld on
        /usr/local/mysql/bin/mysql -e "update mysql.user set password=password(‘$PASSWD‘) where host=‘localhost‘ and user=‘root‘;"
        /usr/local/mysql/bin/mysql -e "update mysql.user set password=password(‘$PASSWD‘) where host=‘127.0.0.1‘ and user=‘root‘;"
        /usr/local/mysql/bin/mysql -e "delete from mysql.user where password=‘‘;"
        /usr/local/mysql/bin/mysql -e "flush privileges;"
        #/usr/local/mysql/bin/mysql -e "select version();" >/dev/null 2>&1
        if [ $? -eq 0 ];then
                echo "+---------------------------+"
                echo "+------mysql安装完成--------+"
                echo "+---------------------------+"
        fi
        #/etc/init.d/mysqld stop
}

install_mysql
时间: 2024-07-29 17:38:52

centos 6.4x64 安装gitlab的相关文章

CentOS源码安装GitLab汉化版

示例环境: 软件 版本 CentOS 6.5 x86_64 Git 2.6.2 Ruby 2.2.3 Node.js 4.2.1 Redis 3.0.5 MariaDB 10.0.21 GitLab 8.0.5汉化版 GitLab Shell 2.6.6 Nginx 1.8.0 Go 1.5.1 Gitlab-git-http-server 0.2.14 一.修改Yum源为阿里云提高下载速度 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.

centos 6.5安装GitLab全过程和问题记录

GitLab,是一个使用 Ruby on Rails 开发的开源应用程序,与Github类似,能够浏览源代码,管理缺陷和注释,非常适合在团队内部使用. 官方只提供了Debian/Ubuntu系统下的安装说明文档,如果需要在centos下安装,可以参考这篇:https://github.com/gitlabhq/gitlab-recipes/tree/master/install/centos,笔者依照这篇文章的说明,成功的在centos系统上安装了gitlab,分享一下自己的安装过程和碰到的问题

CentOS 6.4x64安装git和gitolite服务器

一.部署环境 系统:CentOS 6.4x64 最小化安装 IP:192.168.3.27 二.安装基础依赖包 [[email protected] ~]#yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel -y 三.下载git-2.2.0.tar.gz [[email protected] ~]#wget https://www.kernel.org/pub/software/

CentOS 6.4x64安装部署zabbix-2.4.5

以下内容来自于http://www.iyunv.com/thread-62087-1-1.html 补充一点,按照原文安装万之后zabbix页面会提示 zabbix server is not running: the information displayed may not be current 解决方法(参考自http://fengzhige.blog.51cto.com/3691377/1034485)是: setsebool -P httpd_can_network_connect o

centos 6.5安装GitLab安装

1.安装操作系统 a.安装wget(系统版本是6.5) #yum -y install wget b.增加EPEL安装源 EPEL,即Extra Packages for Enterprise Linux,这个软件仓库里有很多非常常用的软件,而且是专门针对RHEL设计的,对RHEL标准yum源是一个很好的补充,完全免费使用,由 Fedora项目维护,所以如果你使用的是RHEL,或者CentOS,Scientific等RHEL系的linux,可以非常放心的使用EPEL的 yum源. 下载并安装GP

CentOS 6.5 安装Gitlab 7.12.2

官网环境要求 参见:https://github.com/gitlabhq/gitlabhq GitLab is a Ruby on Rails application that runs on the following software: Ubuntu/Debian/CentOS/RHEL Ruby (MRI) 2.1 Git 1.7.10+ Redis 2.0+ MySQL or PostgreSQL For more information please see the architec

centos 6.4x64安装部署nagios

本文参考了http://wangzan18.blog.51cto.com/8021085/1628984 http://linuxnote.blog.51cto.com/9876511/1637773 一.nagios概述 Nagios是插件式的结构,它本身没有任何监控功能,所有的监控都是通过插件进行的,因此其是高度模块化和富于弹性的.Nagios监控的对象可分为两类:主机和服务.主机通常指的是物理主机,如服务器.路由器.工作站和打印机等,这里的主机也可以是虚拟设备,如xen虚拟出的Linux系

CentOS 6.4x64安装部署zabbix

一.部署环境 系统:CentOS 6.4x64 最小化安装 Server:192.168.3.28 Client:192.168.3.29 二.基础软件包安装 在server安装基础软件包,这里的环境使用yum安装,如果使用源码安装也是可以的. [[email protected] ~]# yum -y install wget vim tree gcc gcc-c++ autoconf httpd php mysql mysql-server php-mysql httpd-manual mo

CentOS源码安装GitLab汉化版第2版

软件版本: CentOS 7.2 Git 2.12.0 Ruby 2.3.3 Node.js 6.10.1 Redis 3.2.8 MariaDB 10.1.20 GitLab 8.8.5汉化版 GitLab Shell 2.7.2 Nginx 1.10.3 Go 1.8 GitLab-Workhorse 0.7.1 一.安装依赖 yum -y install libicu-devel patch gcc-c++ readline-devel zlib-devel libffi-devel op