- 浏览: 545075 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (618)
- java (109)
- Java web (43)
- javascript (52)
- js (15)
- 闭包 (2)
- maven (8)
- 杂 (28)
- python (47)
- linux (51)
- git (18)
- (1)
- mysql (31)
- 管理 (1)
- redis (6)
- 操作系统 (12)
- 网络 (13)
- mongo (1)
- nginx (17)
- web (8)
- ffmpeg (1)
- python安装包 (0)
- php (49)
- imagemagic (1)
- eclipse (21)
- django (4)
- 学习 (1)
- 书籍 (1)
- uml (3)
- emacs (19)
- svn (2)
- netty (9)
- joomla (1)
- css (1)
- 推送 (2)
- android (6)
- memcached (2)
- docker、 (0)
- docker (7)
- go (1)
- resin (1)
- groovy (1)
- spring (1)
最新评论
-
chokee:
...
Spring3 MVC 深入研究 -
googleyufei:
很有用, 我现在打算学学Python. 这些资料的很及时.
python的几个实用网站(转的) -
hujingwei1001:
太好了找的就是它
easy explore -
xiangtui:
例子举得不错。。。学习了
java callback -
幻影桃花源:
太好了,謝謝
Spring3 MVC 深入研究
原文地址:http://blog.51yip.com/server/1558.html
linux gitlab nginx 安装 配置 详解
张映 发表于 2013-09-28
分类目录: 服务器相关
花了一天的时间装了一下gitlab,本以为2-3个小时就能搞定的东西,没想到花了一天,被github官网的一键安装包给坑了,gitlab-install-el6.sh,网上很多人说可以用,但是我用不了,我的系统是centos 6.4 x86_64,基本上全新的系统,装了php,nginx,mysql,下面说一下安装的详细过程
一,什么是gitlab
GitLab是一个利用 Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目。
它拥有与Github类似的功能,能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访问,它非常易于浏览提交过的版本并提供一个文件历史库。团队成员可以利用内置的简单聊天程序(Wall)进行交流。它还提供一个代码片段收集功能可以轻松实现代码复用,便于日后有需要的时候进行查找。
个人觉得,gitlab是将来代码版本控制的趋势,就像当年的SVN代替CVS是一样的。多项目的版本控制,代码的review等,优势很明显,特别是项目很多的公司,gitlab能够减轻技术经理的负担,并有效监控代码质量,对技术人员工作状态都能有所了解(可以通过查看commit记录)
二,安装epel源
请参考:centos 推荐使用epel源
三,安装git
yum install git
有的人说一键安装是可以用的,我也相信了,但是不行。有兴趣的朋友,可以下一下试试,其实我的安装,也是在一键安装的基本上改的。以下是一键安装,建议大家不要用,因为根本用不了。
查看复制打印?
git clone https://github.com/mattias-ohlsson/gitlab-installer.git
cd gitlab-installer/ //该目录有一键安装的sh脚本
./gitlab-install-el6.sh
四,安装系统依赖
yum install patch gcc-c++ readline-devel zlib-devel libffi-devel openssl-devel make autoconf automake libtool bison libxml2-devel libxslt-devel libyaml-devel
五,安装rvm
查看复制打印?
curl -L get.rvm.io | sudo bash -s stable
source /etc/profile.d/rvm.sh
rvm pkg install libyaml
rvm install 1.9.3
rvm --default use 1.9.3
gem install bundler
在这里一键安装包有一个严重的问题,
[root@localhost zhangy]# command rvm install 1.9.3-p392 --with-libyaml-dir=/usr/local/rvm/usr
Checking requirements for centos.
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.9.3-p392, this may take a while depending on your cpu(s)...
ruby-1.9.3-p392 - #downloading ruby-1.9.3-p392, this may take a while depending on your connection...
Archive ruby-1.9.3-p392.tar.bz2 checksum did not match, downloading again.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
84 9789k 84 8308k 0 0 14093 0 0:11:51 0:10:03 0:01:48 12600
curl: (18) transfer closed with 1516640 bytes remaining to read
Partial file(18). Only a part of the file was transferred. Removing partial and re-trying.
总是会提示错误,并且会不断的去Removing partial and re-trying.会不断的重复下载,并且没有一次能下载完成,卡死在这儿了。
正确做法是:
查看复制打印?
[root@localhost zhangy]# rvm install 1.9.3
Searching for binary rubies, this might take some time.
Checking requirements for centos.
Requirements installation successful.
ruby-1.9.3-p448 - #configure
ruby-1.9.3-p448 - #download
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9.9M 100 9.9M 0 0 12049 0 0:14:30 0:14:30 --:--:-- 14521
ruby-1.9.3-p448 - #validate archive
ruby-1.9.3-p448 - #extract
ruby-1.9.3-p448 - #validate binary
ruby-1.9.3-p448 - #setup
Saving wrappers to '/usr/local/rvm/wrappers/ruby-1.9.3-p448'........
。。。。。。。。。。。。。以下省略。。。。。。。。。。。。。。
六,创建git用户
查看复制打印?
adduser --system --create-home --comment 'GitLab' git
七,配置gitlab-shell
查看复制打印?
su - git -c "git clone https://github.com/gitlabhq/gitlab-shell.git"
su - git -c "cd gitlab-shell && git checkout v1.3.0"
su - git -c "cp gitlab-shell/config.yml.example gitlab-shell/config.yml"
sed -i "s/localhost/gitlab.51yip.com/g" /home/git/gitlab-shell/config.yml
su - git -c "gitlab-shell/bin/install"
chmod 600 /home/git/.ssh/authorized_keys
chmod 700 /home/git/.ssh
八,安装redis
yum -y install redis
service redis start
chkconfig redis on
九,安装配置mysql
查看复制打印?
yum install mysql-server
chkconfig mysqld on
echo "CREATE DATABASE IF NOT EXISTS gitlabhq_production DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';" | mysql -u root
echo "UPDATE mysql.user SET Password=PASSWORD('123456') WHERE User='root'; FLUSH PRIVILEGES;" | mysql -u root
如果以前设置过mysql的root密码,上面的最后一步的修改 root密码这一步可以不用做。| mysql -u root -p来创建gitlab的数据库了
十,安装配置gitlab
查看复制打印?
su - git -c "git clone https://github.com/gitlabhq/gitlabhq.git gitlab"
su - git -c "cd gitlab;git checkout 5-1-stable"
su git -c "cp config/gitlab.yml.example config/gitlab.yml"
su git -c "mkdir /home/git/gitlab-satellites"
su git -c "mkdir public/uploads"
su git -c "mkdir -p tmp/sockets/"
su git -c "mkdir -p tmp/pids/"
sed -i "s/ host: localhost/ host: gitlab.51yip.com/g" config/gitlab.yml
sed -i "s/from: gitlab@localhost/from: gitlab@gitlab.51yip.com/g" config/gitlab.yml
su git -c "cp config/puma.rb.example config/puma.rb"
su git -c 'git config --global user.name "GitLab"'
su git -c 'git config --global user.email "gitlab@gitlab.51yip.com"'
十一,配置mysql数据库连接
查看复制打印?
su git -c "cp config/database.yml.mysql config/database.yml"
sed -i "s/secure password/mysql的root密码/g" config/database.yml
十二,安装gems
查看复制打印?
yum install libicu-devel
cd /home/git/gitlab
gem install charlock_holmes --version '0.6.9'
yum install mysql-devel
su git -c "bundle install --deployment --without development test postgres"
su git -c "bundle exec rake sidekiq:start RAILS_ENV=production"
export force=yes
su git -c "bundle exec rake gitlab:setup RAILS_ENV=production"
curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/5-1-stable/init.d/gitlab
chmod +x /etc/init.d/gitlab
sed -i "17 a source /etc/profile.d/rvm.sh\nrvm use 1.9.3-p448" /etc/init.d/gitlab
chkconfig gitlab on
service gitlab start
注意:
1,gem install charlock_holmes --version '0.6.9'
查看复制打印?
Enclosing class/module 'rb_mCharlockHolmes' for class EncodingDetector not known
unable to convert "\x80" from ASCII-8BIT to UTF-8 for ext/charlock_holmes/dst/bin/file, skipping
unable to convert "\xEE" from ASCII-8BIT to UTF-8 for ext/charlock_holmes/src/file-5.08/magic/Magdir/wordprocessors, skipping
unable to convert "\xE1" from ASCII-8BIT to UTF-8 for ext/charlock_holmes/src/file-5.08/magic/Magdir/natinst, skipping
如果出现上面的问题,不用理会,不影响使用。
2,su git -c "bundle install --deployment --without development test postgres"
这一步时,如果出现会卡死的情况,卡在Installing foreman (0.61.0) 这儿,请耐心等待
3,gitlab:check时报GitLab Shell version? ... FAIL. Please update gitlab-shell to v1.1.0,不用理会,不影响使用
4,gitlab settings 500错误。一定要加上,su git -c "bundle exec rake sidekiq:start RAILS_ENV=production"
十三,安装配置nginx
查看复制打印?
yum install nginx
curl --output /etc/nginx/conf.d/gitlab.conf https://raw.github.com/gitlabhq/gitlab-recipes/5-1-stable/nginx/gitlab
vim /etc/nginx/conf.d/gitlab.conf
listen gitlab.51yip.com;
server_name gitlab.51yip.com;
十四,设置gitlab-shell
查看复制打印?
vim /home/git/gitlab-shell/bin/gitlab-shell
#!/usr/local/rvm/bin/ruby-1.9.3-p448 //将脚本的Ruby版本指向到ruby-1.9.3-p448安装版本
十五,重启gitlab和nginx
查看复制打印?
/etc/init.d/nginx restart
/etc/init.d/gitlab restart
[root@gitlab conf.d]# /home/git/gitlab-shell/bin/check //不报错就OK了
Check GitLab API access: OK
Check directories and files:
/home/git/repositories: OK
/home/git/.ssh/authorized_keys: OK
有一点要注意,就是gitlab5-0-stable和gitlab5-1-stable有一点不同的是,启动成功后,gitlab5-0-stable是有启动进程的如下图,而gitlab5-1-stable,是没有的。推荐大家使用5-1-stable。
gitlab start
gitlab start
到这儿,gitlab就安装完成了,其实挺麻烦的,要耐下心来,一步一步来完成就行了,来看一下效果图:
gitlab 完成
gitlab 完成
>用户名:admin@local.host
密 码:5iveL!fe
0
转载请注明
作者:海底苍鹰
地址:http://blog.51yip.com/server/1558.html
linux gitlab nginx 安装 配置 详解
张映 发表于 2013-09-28
分类目录: 服务器相关
花了一天的时间装了一下gitlab,本以为2-3个小时就能搞定的东西,没想到花了一天,被github官网的一键安装包给坑了,gitlab-install-el6.sh,网上很多人说可以用,但是我用不了,我的系统是centos 6.4 x86_64,基本上全新的系统,装了php,nginx,mysql,下面说一下安装的详细过程
一,什么是gitlab
GitLab是一个利用 Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目。
它拥有与Github类似的功能,能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访问,它非常易于浏览提交过的版本并提供一个文件历史库。团队成员可以利用内置的简单聊天程序(Wall)进行交流。它还提供一个代码片段收集功能可以轻松实现代码复用,便于日后有需要的时候进行查找。
个人觉得,gitlab是将来代码版本控制的趋势,就像当年的SVN代替CVS是一样的。多项目的版本控制,代码的review等,优势很明显,特别是项目很多的公司,gitlab能够减轻技术经理的负担,并有效监控代码质量,对技术人员工作状态都能有所了解(可以通过查看commit记录)
二,安装epel源
请参考:centos 推荐使用epel源
三,安装git
yum install git
有的人说一键安装是可以用的,我也相信了,但是不行。有兴趣的朋友,可以下一下试试,其实我的安装,也是在一键安装的基本上改的。以下是一键安装,建议大家不要用,因为根本用不了。
查看复制打印?
git clone https://github.com/mattias-ohlsson/gitlab-installer.git
cd gitlab-installer/ //该目录有一键安装的sh脚本
./gitlab-install-el6.sh
四,安装系统依赖
yum install patch gcc-c++ readline-devel zlib-devel libffi-devel openssl-devel make autoconf automake libtool bison libxml2-devel libxslt-devel libyaml-devel
五,安装rvm
查看复制打印?
curl -L get.rvm.io | sudo bash -s stable
source /etc/profile.d/rvm.sh
rvm pkg install libyaml
rvm install 1.9.3
rvm --default use 1.9.3
gem install bundler
在这里一键安装包有一个严重的问题,
[root@localhost zhangy]# command rvm install 1.9.3-p392 --with-libyaml-dir=/usr/local/rvm/usr
Checking requirements for centos.
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.9.3-p392, this may take a while depending on your cpu(s)...
ruby-1.9.3-p392 - #downloading ruby-1.9.3-p392, this may take a while depending on your connection...
Archive ruby-1.9.3-p392.tar.bz2 checksum did not match, downloading again.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
84 9789k 84 8308k 0 0 14093 0 0:11:51 0:10:03 0:01:48 12600
curl: (18) transfer closed with 1516640 bytes remaining to read
Partial file(18). Only a part of the file was transferred. Removing partial and re-trying.
总是会提示错误,并且会不断的去Removing partial and re-trying.会不断的重复下载,并且没有一次能下载完成,卡死在这儿了。
正确做法是:
查看复制打印?
[root@localhost zhangy]# rvm install 1.9.3
Searching for binary rubies, this might take some time.
Checking requirements for centos.
Requirements installation successful.
ruby-1.9.3-p448 - #configure
ruby-1.9.3-p448 - #download
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9.9M 100 9.9M 0 0 12049 0 0:14:30 0:14:30 --:--:-- 14521
ruby-1.9.3-p448 - #validate archive
ruby-1.9.3-p448 - #extract
ruby-1.9.3-p448 - #validate binary
ruby-1.9.3-p448 - #setup
Saving wrappers to '/usr/local/rvm/wrappers/ruby-1.9.3-p448'........
。。。。。。。。。。。。。以下省略。。。。。。。。。。。。。。
六,创建git用户
查看复制打印?
adduser --system --create-home --comment 'GitLab' git
七,配置gitlab-shell
查看复制打印?
su - git -c "git clone https://github.com/gitlabhq/gitlab-shell.git"
su - git -c "cd gitlab-shell && git checkout v1.3.0"
su - git -c "cp gitlab-shell/config.yml.example gitlab-shell/config.yml"
sed -i "s/localhost/gitlab.51yip.com/g" /home/git/gitlab-shell/config.yml
su - git -c "gitlab-shell/bin/install"
chmod 600 /home/git/.ssh/authorized_keys
chmod 700 /home/git/.ssh
八,安装redis
yum -y install redis
service redis start
chkconfig redis on
九,安装配置mysql
查看复制打印?
yum install mysql-server
chkconfig mysqld on
echo "CREATE DATABASE IF NOT EXISTS gitlabhq_production DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';" | mysql -u root
echo "UPDATE mysql.user SET Password=PASSWORD('123456') WHERE User='root'; FLUSH PRIVILEGES;" | mysql -u root
如果以前设置过mysql的root密码,上面的最后一步的修改 root密码这一步可以不用做。| mysql -u root -p来创建gitlab的数据库了
十,安装配置gitlab
查看复制打印?
su - git -c "git clone https://github.com/gitlabhq/gitlabhq.git gitlab"
su - git -c "cd gitlab;git checkout 5-1-stable"
su git -c "cp config/gitlab.yml.example config/gitlab.yml"
su git -c "mkdir /home/git/gitlab-satellites"
su git -c "mkdir public/uploads"
su git -c "mkdir -p tmp/sockets/"
su git -c "mkdir -p tmp/pids/"
sed -i "s/ host: localhost/ host: gitlab.51yip.com/g" config/gitlab.yml
sed -i "s/from: gitlab@localhost/from: gitlab@gitlab.51yip.com/g" config/gitlab.yml
su git -c "cp config/puma.rb.example config/puma.rb"
su git -c 'git config --global user.name "GitLab"'
su git -c 'git config --global user.email "gitlab@gitlab.51yip.com"'
十一,配置mysql数据库连接
查看复制打印?
su git -c "cp config/database.yml.mysql config/database.yml"
sed -i "s/secure password/mysql的root密码/g" config/database.yml
十二,安装gems
查看复制打印?
yum install libicu-devel
cd /home/git/gitlab
gem install charlock_holmes --version '0.6.9'
yum install mysql-devel
su git -c "bundle install --deployment --without development test postgres"
su git -c "bundle exec rake sidekiq:start RAILS_ENV=production"
export force=yes
su git -c "bundle exec rake gitlab:setup RAILS_ENV=production"
curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/5-1-stable/init.d/gitlab
chmod +x /etc/init.d/gitlab
sed -i "17 a source /etc/profile.d/rvm.sh\nrvm use 1.9.3-p448" /etc/init.d/gitlab
chkconfig gitlab on
service gitlab start
注意:
1,gem install charlock_holmes --version '0.6.9'
查看复制打印?
Enclosing class/module 'rb_mCharlockHolmes' for class EncodingDetector not known
unable to convert "\x80" from ASCII-8BIT to UTF-8 for ext/charlock_holmes/dst/bin/file, skipping
unable to convert "\xEE" from ASCII-8BIT to UTF-8 for ext/charlock_holmes/src/file-5.08/magic/Magdir/wordprocessors, skipping
unable to convert "\xE1" from ASCII-8BIT to UTF-8 for ext/charlock_holmes/src/file-5.08/magic/Magdir/natinst, skipping
如果出现上面的问题,不用理会,不影响使用。
2,su git -c "bundle install --deployment --without development test postgres"
这一步时,如果出现会卡死的情况,卡在Installing foreman (0.61.0) 这儿,请耐心等待
3,gitlab:check时报GitLab Shell version? ... FAIL. Please update gitlab-shell to v1.1.0,不用理会,不影响使用
4,gitlab settings 500错误。一定要加上,su git -c "bundle exec rake sidekiq:start RAILS_ENV=production"
十三,安装配置nginx
查看复制打印?
yum install nginx
curl --output /etc/nginx/conf.d/gitlab.conf https://raw.github.com/gitlabhq/gitlab-recipes/5-1-stable/nginx/gitlab
vim /etc/nginx/conf.d/gitlab.conf
listen gitlab.51yip.com;
server_name gitlab.51yip.com;
十四,设置gitlab-shell
查看复制打印?
vim /home/git/gitlab-shell/bin/gitlab-shell
#!/usr/local/rvm/bin/ruby-1.9.3-p448 //将脚本的Ruby版本指向到ruby-1.9.3-p448安装版本
十五,重启gitlab和nginx
查看复制打印?
/etc/init.d/nginx restart
/etc/init.d/gitlab restart
[root@gitlab conf.d]# /home/git/gitlab-shell/bin/check //不报错就OK了
Check GitLab API access: OK
Check directories and files:
/home/git/repositories: OK
/home/git/.ssh/authorized_keys: OK
有一点要注意,就是gitlab5-0-stable和gitlab5-1-stable有一点不同的是,启动成功后,gitlab5-0-stable是有启动进程的如下图,而gitlab5-1-stable,是没有的。推荐大家使用5-1-stable。
gitlab start
gitlab start
到这儿,gitlab就安装完成了,其实挺麻烦的,要耐下心来,一步一步来完成就行了,来看一下效果图:
gitlab 完成
gitlab 完成
>用户名:admin@local.host
密 码:5iveL!fe
0
转载请注明
作者:海底苍鹰
地址:http://blog.51yip.com/server/1558.html
发表评论
-
Android上使用git
2014-12-04 15:17 705原文地址:http://www.linuxidc.com/Li ... -
修改了SSH默认端口之后,如何配置GIT?
2014-11-07 17:29 512原文地址:http://zengrong.net/post/1 ... -
bitbucket代理
2014-09-17 11:52 637杨霏(769860828) 2014-07-02 12:07: ... -
bitbucket代理
2014-09-17 11:16 1663原文地址:http://segmentfault.com/q/ ... -
RHEL(redhat 5.x,6.x)和CentOS上Gitlab安装全过程
2014-06-26 10:28 875原文地址:http://blog.csdn.net/ypjya ... -
在centos里安装gitlab
2014-06-26 10:23 604原文地址:http://dl528888.blog.51cto ... -
搭建 Linux 下 GitLab 服务器
2014-06-18 14:50 1312原文地址:http://blog.csdn ... -
git/github初级运用自如
2013-11-22 09:25 616之前初学过一点git版本控制工具,利用github做仓 ... -
用GIT做版本控制-并上传至github(转)
2013-11-22 09:24 752安装Git 源码安装: Git的工作需要调用curl,z ... -
Github上线Trending功能,帮你轻松找到有潜力的开源项目
2013-08-21 11:22 666声明:ITeye资讯文章的版权属于ITeye网站所有,严禁任 ... -
linux常用命令(自己用)
2013-08-20 09:40 675find . -name 'test*'grep -r t ... -
git使用总结(自己用)
2013-08-20 09:40 5121、查看所有分支$ git branch -a2、删除远程 ... -
GitHub使用(一)-- 生成本地项目并上传
2013-08-13 09:49 466由于经常要在家写代码,所以需要有个能够方便访问代码管理工具。 ... -
主题:Git常用命令备忘
2013-07-15 14:55 683Git配置 Java代码 git ... -
(自己收藏)Git 常用命令详解(二)
2013-04-27 10:38 811Git 常用命令详解(二) ... -
Git笔记-进阶
2013-04-24 12:59 755Git笔记-进阶 2011-09-12 17:33:13发 ... -
Git笔记-基础
2013-04-24 12:59 798Git笔记-基础 2011-08-10 1 ...
相关推荐
linux下安装Nginx以及配置文件详解,安装说明,所用要的包安装方法顺序步骤,配置文件详解~~~
Linux中Nginx安装与配置详解 包含文档 图解以及需要的rpm包 需要的软件等
Linux Centos7中搭建Nginx负载均衡,里面包含了详细文档(ps:有详细的操作步骤哟),还有相关的安装包以及测试包
linux下Nginx+tomcat整合的安装与配置
linux下安装nginx被配置sticky模块的相关软件包,包含nginx.conf的简单实例
配置系统nginx,使gitlab使用系统自带的nginx,配置端口号,禁止使用自身绑定的nginx,
linux安装nginx并支持ssl,使得服务器支持证书签名,提升应用的安全性
windows下 php+nginx配置详解,经整理修改测试通过,希望和大家一起分享!
NULL 博文链接:https://aperise.iteye.com/blog/2223373
此文档包含 了nginx 安装步骤,模块说明,配置详解,使用场景
nginx安装、不同配置含义、常用命令、安全等方面的介绍
windows 下安装配置 Nginx 详解 - CSDN博客装配置 Nginx 详解阅读数:4348装配置 Nginx 详解本地服务器,通过配置server_
Nginx配置文件的对应模块及模块属性详细说明。此外,还有一个实例帮助更好的了解Nginx配置
linuxnginx安装配置文件支持php.pdf
对nginx配置文件nginx.conf各个表示的意思进行解释,方便新人学习
proxy_read_timeout
linux下nginx离线安装包--附带所有依赖环境和安装教程,当linux无外网情况下,可通过此安装版安装,一次性解决所有依赖,按照压缩包内教程,即可从头到尾安装完毕
一、nginx介绍及功能讲解 二、nginx的安装 三、nginx配置相关指令 四、nginx的实例应用(项目部署)
Linux nginx安装配置步骤.txt
Nginx配置文件 nginx.conf 详解doc文档