Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2680
  • 博文数量: 1
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 20
  • 用 户 组: 普通用户
  • 注册时间: 2013-12-18 14:52
文章分类
文章存档

2014年(1)

我的朋友
最近访客

分类: LINUX

2014-01-22 10:33:05

1.安装依赖库

yum install libicu-devel mysql-develpcre-devel

安装python,官方要求版本必须在2.5以上,而且不支持3.0,而CentOS5.5默认的Python版本是2.4的,此时就需要手动升级Python

下载python版本

wget -c

编译安装python  

tar -zxvfPython-3.3.0.tgz

cd Python-3.3.0

./configure

make all

make install

清除之前编译的可执行文件及配置文件

make clean

清除所有生成的文件

查看python版本信息

/usr/local/bin/python3 –V


spacer.gif

将之前版本的python备份

mv python python.old

将编译安装的python建立软连接

ln -s /usr/local/bin/python3.3 /usr/bin/python

保证之前python2也可以使用

ln -s /usr/bin/python /usr/bin/python2

安装Ruby

curl--progress | tarxz
cd ruby-1.9.3-p392 
./configure 
make 
make install

RVM方式

curl -#L | bash-s stable --ruby

注:如果安装的时候出现failedFile "/usr/bin/yum", line 30except KeyboardInterrupt, e:,就需要将/usr/bin/yum里面的第一行"#!/usr/bin/python"改为 "#!/usr/bin/python2.4",修改之后重新执行命令。

这里可能需要等好长时间了。

执行完成之后需要执行以下命令

注:如果执行的时候报错,那么需要执行source/usr/local/rvm/scripts/rvm

然后再去重新执行rvm方式

rvm install ruby-1.9.3-p392

安装bundler

gem install bundler

添加git用户

adduser --comment 'GitLab' git

git用户无密码登陆

chmod 644 /etc/shadow

vi /etc/shadow

删掉感叹号:

git:!!:15814:0:99999:7::: 修改为 git::15814:0:99999:7:::

git用户加入到sudo

chmod u+w /etc/sudoers

vi /etc/sudoers


## Allow root to run any commands  anywhere

root ALL=(ALL) ALL

git ALL=(ALL)  NOPASSWD:ALL #加入这行#

# %wheel ALL=(ALL) NOPASSWD:ALL 改为

%wheel ALL=(ALL) NOPASSWD:ALL


现在切换git用户

安装依赖包

sudo yum install zlib-devel

sudo yum install openssl-devel

sudo yum install perl

sudo yum install cpio

sudo yum install expat-devel

sudo yum install gettext-devel

sudo yum install gcc


安装Curlroot用户)


tar xzvf curl-7.18.0.tar.gz

cd curl-7.18.0

./configure

make

sudo make install


确定一下ld.so.conf文件里有/usr/local/lib,这个是为git-http-push准备的.

sudo vi /etc/ld.so.conf

#插入下面的代码

/usr/local/lib

保存文件,接着运行:

sudo /sbin/ldconfig

下载git并安装

根据这个网址最新的版本是1.8.5.2

tar xzvf git-latest.tar.gz

cd git-1.8.5.2

autoconf(如果终端提示no command的话就yum install autoconf,千万不要以为文件夹中有makefile就好直接make了,不然会出错的)

./configure --with-curl=/usr/local

make

sudo make install

克隆GitLab Shell

git clone git://github.com/gitlabhq/gitlab-shell.git

cd gitlab-shell

git checkout v1.1.0

git checkout -b v1.1.0

生产配置文件

cp config.yml.example config.yml

更改配置信息,一般就改下你部署的域名地址gitlab_url

vi config.yml


# Url to gitlab instance. Used for api calls. Shouldbe ends with slash.

gitlab_url: "" #改成你的域名或者IP

安装

./bin/install

切换回root用户安装数据库

yum install -y mysql-server mysqlmysql-devel

启动数据库

service mysqld start

初始化GitLab数据库




mysql -u root -p

Enter password: (直接按回车键)

Welcome to the MySQL monitor.

Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.5.30 MySQL Community  Server (GPL)


Copyright (c) 2000, 2013, Oracle and/or  its affiliates. All rights reserved.


Oracle is a registered trademark of  Oracle Corporation and/or its affiliates. Other names may be trademarks of  their respective owners.


Type 'help;' or '\h' for help. Type '\c'  to clear the current input statement.


mysql> CREATE USER 'gitlab'@'localhost'  IDENTIFIED BY 'gitlab';

Query OK, 0 rows affected (0.01 sec)


mysql> CREATE DATABASE IF NOT EXISTS  `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;

Query OK, 1 row affected (0.00 sec)


mysql>

Query OK, 0 rows affected (0.00 sec)


mysql> exit

Bye

测试gitlab用户连接mysql

Enter password:gitlab

测试通过,连接成功

终于到GitLab的安装了,进入git用户

su - git

克隆GitLab

克隆出现error,需要执行这条命令,关闭全局证书验证

sudo -u git -H git clone gitlab
cdgitlab

切换到5.0稳定分支


配置

cd /home/git/gitlab


用样例配置生成gitlab配置

sudo -u git -H cp config/gitlab.yml.exampleconfig/gitlab.yml


更改域名


确保gitlab log/  tmp/ 目录有写权限

sudo chown -R git log/

sudo chown -R git tmp/

sudo chmod -R u+rwX log/

sudo chmod -R u+rwX tmp/


创建附属目录

sudo -u git -H mkdir /home/git/gitlab-satellites


创建pids目录并确保对gitlab可写

sudo -u git -H mkdir tmp/pids/

sudo chmod -R u+rwX tmp/pids/


生成Unicorn配置

sudo -u git -H cp config/unicorn.rb.exampleconfig/unicorn.rb

配置GitLab DB设置

# sudo -u git cp config/database.yml.mysqlconfig/database.yml

安装Gems

cd /home/git/gitlab

Installing libyaml

$ wget 0.1.4.tar.gz
$ tar xzvf yaml-0.1.4.tar.gz
$ cd yaml-0.1.4 $ ./configure --prefix=/usr/local $ make

$ make install

那位如果编译安装成功了,请告知我报错处理的方法。谢谢啦。

时间紧,截图神马的都是浮云,就不提了。


阅读(255) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:没有了

给主人留下些什么吧!~~