- 浏览: 543332 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (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://dl528888.blog.51cto.com/2382721/1213286
在centos里安装gitlab
2013-05-30 17:28:13
标签:gitlab的安装 centos安装gitlab redhat安装gitlab
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://dl528888.blog.51cto.com/2382721/1213286
最近换了公司,在交接公司,所以很忙也没有时间写博客,同时随着能力的逐渐提升,很多知识感觉很简单,也没有必要专门写博客,只是把遇到的情况与解决方法写入到了笔记里,正好现在没什么事,就把我最近研究的gitlab如何在centos里安装的笔记分享给大家。
先给大家介绍一下gitlab
GitLab 是一个用于仓库管理系统的开源项目。使用Git作为代码管理工具,并在此基础上搭建起来的web服务。
应用特点:
1. Web框架使用Ruby on Rails。
2. 基于MIT代码发布协议。
3. 需要gitolite协同工作。
安装GitLab的需求:
Ubuntu/Debian(推荐这2个系统,也可以安装到CentOS系统中,并且在GitHub上有CentOS的GitLab一键安装脚本)
官方推荐的是那2个系统,但我这里需要安装在centos里,所以没办法自己多研究与测试,总结的安装经验如下:
前置要求
一定要先关闭iptable与selinux
本文安装的系统为centos 6.2 64位系统,安装在dell r410机器
1、安装epel与基础依赖库及软件
1
2
3
4
cd /tmp
wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
yum install -y readline-devel libyaml-devel gdbm-devel ncurses-devel redis openssl-devel zlib-devel gcc gcc-c++ make autoconf readline-devel curl-devel expat-devel gettext-devel tk-devel libxml2-devel libffi-devel libxslt-devel libicu-devel httpd httpd-devel gitolite git-all python-devel python-pip sqlite-devel sendmail vim mysql-devel mysql-server patch libyaml* pcre-devel
2、安装ruby(一般默认安装都是1.8的,官方要求1.9以上)
1
2
3
4
5
6
7
8
9
10
mkdir /tmp/ruby && cd /tmp/ruby
curl --progress http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz | tar xz
cd ruby-1.9.3-p392/
./configure
make
make install
gem install bundler
ln -s /usr/local/bin/ruby /usr/bin/ruby
ln -s /usr/local/bin/gem /usr/bin/gem
ln -s /usr/local/bin/bundle /usr/bin/bundle
3、创建一个git用户供GitLab使用
1
2
adduser --comment 'GitLab' git
chmod –R 755 /home/git
4、安装gitlab 的shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Login as git
sudo su git
# Go to home directory
cd /home/git
# Clone gitlab shell
git clone https://github.com/gitlabhq/gitlab-shell.git
cd gitlab-shell
# switch to right version
git checkout v1.3.0
cp config.yml.example config.yml
# Edit config and replace gitlab_url
# with something like 'http://domain.com/'
vim config.yml
# Do setup
./bin/install
5、建立gitlab数据库并授权
1
2
3
4
5
6
7
8
9
10
# Login to MySQL
mysql -u root -p
# Create a user for GitLab. (change $password to a real password)
mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY 'gitlab';
# Create the GitLab production database
mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
# Grant the GitLab user necessary permissopns on the table.
mysql> GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost';
# Quit the database session
mysql> \q
6、克隆gitlab源
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Clone GitLab repository
cd /home/git
sudo -u git -H git clone https://github.com/gitlabhq/gitlabhq.git gitlab
# Go to gitlab dir
cd /home/git/gitlab
# Checkout to stable release
sudo -u git -H git checkout 5-1-stable
Configure it
cd /home/git/gitlab
# Copy the example GitLab config
sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml
# Make sure to change "localhost" to the fully-qualified domain name of your
# host serving GitLab where necessary
sudo -u git -H vim config/gitlab.yml
# Make sure GitLab can write to the log/ and tmp/ directories
sudo chown -R git log/
sudo chown -R git tmp/
sudo chmod -R u+rwX log/
sudo chmod -R u+rwX tmp/
# Create directory for satellites
sudo -u git -H mkdir /home/git/gitlab-satellites
# Create directories for sockets/pids and make sure GitLab can write to them
sudo -u git -H mkdir tmp/pids/
sudo -u git -H mkdir tmp/sockets/
sudo chmod -R u+rwX tmp/pids/
sudo chmod -R u+rwX tmp/sockets/
# Create public/uploads directory otherwise backup will fail
sudo -u git -H mkdir public/uploads
sudo chmod -R u+rwX public/uploads
# Copy the example Puma config
sudo -u git -H cp config/puma.rb.example config/puma.rb
# Configure Git global settings for git user, useful when editing via web
# Edit user.email according to what is set in gitlab.yml
sudo -u git -H git config --global user.name "GitLab"
sudo -u git -H git config --global user.email "gitlab@localhost"
7、配置gitlab数据库
1
2
3
sudo -u git cp config/database.yml.mysql config/database.yml
sudo -u git vim config/database.yml
Make sure to update username/password in config/database.yml.
这个数据库的账户与密码是在第5步那里创建的。
8、安装gem
1
2
3
cd /home/git/gitlab
sudo gem install charlock_holmes --version '0.6.9.4'
sudo -u git -H bundle install --deployment --without development test postgres
9、启动redis
1
/etc/init.d/redis start
10、对数据库进行初始化
1
sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
11、下载启动脚本
1
2
3
4
5
Download the init script (will be /etc/init.d/gitlab):
sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/master/lib/support/init.d/gitlab
sudo chmod +x /etc/init.d/gitlab
Make GitLab start on boot:
chkconfig --add gitlab
12、检测应用状态
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Check if GitLab and its environment are configured correctly:
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
To make sure you didn't miss anything run a more thorough check with:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
If all items are green, then congratulations on successfully installing GitLab! However there are still a few steps left.
出现了Running? ... no
Try fixing it:
sudo -u git -H bundle exec rake sidekiq:start RAILS_ENV=production
For more information see:
doc/install/installation.md in section "Install Init Script"
see log/sidekiq.log for possible errors
Please fix the error above and rerun the checks.
运行sudo -u git -H bundle exec rake sidekiq:start RAILS_ENV=production
然后在运行sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
13、启动gitlab
1
sudo service gitlab start
14、下载nginx(我选nging作为web服务器)
1
yum install nginx
15、下载官方提供gitlab的虚拟配置文件,并修改配置
1
2
3
4
5
6
7
8
9
10
11
12
13
Download an example site config:
sudo curl --output /etc/nginx/conf.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/master/lib/support/nginx/gitlab
Make sure to edit the config file to match your setup:
# **YOUR_SERVER_FQDN** to the fully-qualified
# domain name of your host serving GitLab. Also, replace
# the 'listen' line with the following:
# listen 80 default_server; # e.g., listen 192.168.1.1:80;
sudo vim /etc/nginx/conf.d/gitlab
cd /etc/nginx/conf.d
mv default.conf default.conf.bak
mv gitlab default.conf
Restart
sudo service nginx restart
16、登陆你在nginx里添加的ip,然后输入账户与密码,默认为
1
2
admin@local.host
5iveL!fe
现在就完成了gitlab在centos系统里的安装,希望本文对大家有益。
本文出自 “吟—技术交流” 博客,请务必保留此出处http://dl528888.blog.51cto.com/2382721/1213286
在centos里安装gitlab
2013-05-30 17:28:13
标签:gitlab的安装 centos安装gitlab redhat安装gitlab
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://dl528888.blog.51cto.com/2382721/1213286
最近换了公司,在交接公司,所以很忙也没有时间写博客,同时随着能力的逐渐提升,很多知识感觉很简单,也没有必要专门写博客,只是把遇到的情况与解决方法写入到了笔记里,正好现在没什么事,就把我最近研究的gitlab如何在centos里安装的笔记分享给大家。
先给大家介绍一下gitlab
GitLab 是一个用于仓库管理系统的开源项目。使用Git作为代码管理工具,并在此基础上搭建起来的web服务。
应用特点:
1. Web框架使用Ruby on Rails。
2. 基于MIT代码发布协议。
3. 需要gitolite协同工作。
安装GitLab的需求:
Ubuntu/Debian(推荐这2个系统,也可以安装到CentOS系统中,并且在GitHub上有CentOS的GitLab一键安装脚本)
官方推荐的是那2个系统,但我这里需要安装在centos里,所以没办法自己多研究与测试,总结的安装经验如下:
前置要求
一定要先关闭iptable与selinux
本文安装的系统为centos 6.2 64位系统,安装在dell r410机器
1、安装epel与基础依赖库及软件
1
2
3
4
cd /tmp
wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
yum install -y readline-devel libyaml-devel gdbm-devel ncurses-devel redis openssl-devel zlib-devel gcc gcc-c++ make autoconf readline-devel curl-devel expat-devel gettext-devel tk-devel libxml2-devel libffi-devel libxslt-devel libicu-devel httpd httpd-devel gitolite git-all python-devel python-pip sqlite-devel sendmail vim mysql-devel mysql-server patch libyaml* pcre-devel
2、安装ruby(一般默认安装都是1.8的,官方要求1.9以上)
1
2
3
4
5
6
7
8
9
10
mkdir /tmp/ruby && cd /tmp/ruby
curl --progress http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz | tar xz
cd ruby-1.9.3-p392/
./configure
make
make install
gem install bundler
ln -s /usr/local/bin/ruby /usr/bin/ruby
ln -s /usr/local/bin/gem /usr/bin/gem
ln -s /usr/local/bin/bundle /usr/bin/bundle
3、创建一个git用户供GitLab使用
1
2
adduser --comment 'GitLab' git
chmod –R 755 /home/git
4、安装gitlab 的shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Login as git
sudo su git
# Go to home directory
cd /home/git
# Clone gitlab shell
git clone https://github.com/gitlabhq/gitlab-shell.git
cd gitlab-shell
# switch to right version
git checkout v1.3.0
cp config.yml.example config.yml
# Edit config and replace gitlab_url
# with something like 'http://domain.com/'
vim config.yml
# Do setup
./bin/install
5、建立gitlab数据库并授权
1
2
3
4
5
6
7
8
9
10
# Login to MySQL
mysql -u root -p
# Create a user for GitLab. (change $password to a real password)
mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY 'gitlab';
# Create the GitLab production database
mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
# Grant the GitLab user necessary permissopns on the table.
mysql> GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost';
# Quit the database session
mysql> \q
6、克隆gitlab源
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Clone GitLab repository
cd /home/git
sudo -u git -H git clone https://github.com/gitlabhq/gitlabhq.git gitlab
# Go to gitlab dir
cd /home/git/gitlab
# Checkout to stable release
sudo -u git -H git checkout 5-1-stable
Configure it
cd /home/git/gitlab
# Copy the example GitLab config
sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml
# Make sure to change "localhost" to the fully-qualified domain name of your
# host serving GitLab where necessary
sudo -u git -H vim config/gitlab.yml
# Make sure GitLab can write to the log/ and tmp/ directories
sudo chown -R git log/
sudo chown -R git tmp/
sudo chmod -R u+rwX log/
sudo chmod -R u+rwX tmp/
# Create directory for satellites
sudo -u git -H mkdir /home/git/gitlab-satellites
# Create directories for sockets/pids and make sure GitLab can write to them
sudo -u git -H mkdir tmp/pids/
sudo -u git -H mkdir tmp/sockets/
sudo chmod -R u+rwX tmp/pids/
sudo chmod -R u+rwX tmp/sockets/
# Create public/uploads directory otherwise backup will fail
sudo -u git -H mkdir public/uploads
sudo chmod -R u+rwX public/uploads
# Copy the example Puma config
sudo -u git -H cp config/puma.rb.example config/puma.rb
# Configure Git global settings for git user, useful when editing via web
# Edit user.email according to what is set in gitlab.yml
sudo -u git -H git config --global user.name "GitLab"
sudo -u git -H git config --global user.email "gitlab@localhost"
7、配置gitlab数据库
1
2
3
sudo -u git cp config/database.yml.mysql config/database.yml
sudo -u git vim config/database.yml
Make sure to update username/password in config/database.yml.
这个数据库的账户与密码是在第5步那里创建的。
8、安装gem
1
2
3
cd /home/git/gitlab
sudo gem install charlock_holmes --version '0.6.9.4'
sudo -u git -H bundle install --deployment --without development test postgres
9、启动redis
1
/etc/init.d/redis start
10、对数据库进行初始化
1
sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
11、下载启动脚本
1
2
3
4
5
Download the init script (will be /etc/init.d/gitlab):
sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/master/lib/support/init.d/gitlab
sudo chmod +x /etc/init.d/gitlab
Make GitLab start on boot:
chkconfig --add gitlab
12、检测应用状态
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Check if GitLab and its environment are configured correctly:
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
To make sure you didn't miss anything run a more thorough check with:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
If all items are green, then congratulations on successfully installing GitLab! However there are still a few steps left.
出现了Running? ... no
Try fixing it:
sudo -u git -H bundle exec rake sidekiq:start RAILS_ENV=production
For more information see:
doc/install/installation.md in section "Install Init Script"
see log/sidekiq.log for possible errors
Please fix the error above and rerun the checks.
运行sudo -u git -H bundle exec rake sidekiq:start RAILS_ENV=production
然后在运行sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
13、启动gitlab
1
sudo service gitlab start
14、下载nginx(我选nging作为web服务器)
1
yum install nginx
15、下载官方提供gitlab的虚拟配置文件,并修改配置
1
2
3
4
5
6
7
8
9
10
11
12
13
Download an example site config:
sudo curl --output /etc/nginx/conf.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/master/lib/support/nginx/gitlab
Make sure to edit the config file to match your setup:
# **YOUR_SERVER_FQDN** to the fully-qualified
# domain name of your host serving GitLab. Also, replace
# the 'listen' line with the following:
# listen 80 default_server; # e.g., listen 192.168.1.1:80;
sudo vim /etc/nginx/conf.d/gitlab
cd /etc/nginx/conf.d
mv default.conf default.conf.bak
mv gitlab default.conf
Restart
sudo service nginx restart
16、登陆你在nginx里添加的ip,然后输入账户与密码,默认为
1
2
admin@local.host
5iveL!fe
现在就完成了gitlab在centos系统里的安装,希望本文对大家有益。
本文出自 “吟—技术交流” 博客,请务必保留此出处http://dl528888.blog.51cto.com/2382721/1213286
发表评论
-
Android上使用git
2014-12-04 15:17 702原文地址:http://www.linuxidc.com/Li ... -
修改了SSH默认端口之后,如何配置GIT?
2014-11-07 17:29 511原文地址:http://zengrong.net/post/1 ... -
bitbucket代理
2014-09-17 11:52 634杨霏(769860828) 2014-07-02 12:07: ... -
bitbucket代理
2014-09-17 11:16 1659原文地址:http://segmentfault.com/q/ ... -
RHEL(redhat 5.x,6.x)和CentOS上Gitlab安装全过程
2014-06-26 10:28 870原文地址:http://blog.csdn.net/ypjya ... -
linux gitlab nginx 安装 配置 详解
2014-06-26 10:23 904原文地址:http://blog.51yi ... -
搭建 Linux 下 GitLab 服务器
2014-06-18 14:50 1308原文地址:http://blog.csdn ... -
git/github初级运用自如
2013-11-22 09:25 613之前初学过一点git版本控制工具,利用github做仓 ... -
用GIT做版本控制-并上传至github(转)
2013-11-22 09:24 748安装Git 源码安装: Git的工作需要调用curl,z ... -
Github上线Trending功能,帮你轻松找到有潜力的开源项目
2013-08-21 11:22 664声明:ITeye资讯文章的版权属于ITeye网站所有,严禁任 ... -
linux常用命令(自己用)
2013-08-20 09:40 670find . -name 'test*'grep -r t ... -
git使用总结(自己用)
2013-08-20 09:40 5101、查看所有分支$ git branch -a2、删除远程 ... -
GitHub使用(一)-- 生成本地项目并上传
2013-08-13 09:49 462由于经常要在家写代码,所以需要有个能够方便访问代码管理工具。 ... -
主题:Git常用命令备忘
2013-07-15 14:55 682Git配置 Java代码 git ... -
(自己收藏)Git 常用命令详解(二)
2013-04-27 10:38 808Git 常用命令详解(二) ... -
Git笔记-进阶
2013-04-24 12:59 752Git笔记-进阶 2011-09-12 17:33:13发 ... -
Git笔记-基础
2013-04-24 12:59 793Git笔记-基础 2011-08-10 1 ...
相关推荐
Centos7安装Gitlab
centos7安装部署gitlab服务器,1. 安装依赖软件2.设置postfix开机自启,并启动,postfix支持gitlab发信功能3.下载gitlab安装包,然后安装4.配置GITLAB
公司最近服务器中病毒,然后做一个gitlab迁移,已实践!,可以说是良心作品了,积分也不高,还望评论下(好评)谢谢
CentOS 7 下安装 Gitlab-CE-11及邮件配置,安装步骤和邮件配置参数
这是一个关于阿里云服务器CentOS7.2安装配置gitlab工具的配置文档,初学者可以据此配置,但要注意根据自己的下载和安装路径,当然仿照文档内的路径,也完全没问题。
Centos7 源码安装Gitlab.md 存放这里,让大家下载快捷一点
centos安装 ruby-1.9.3-p0 报错 EC_GROUP_new_curve_GF2m
主要介绍了centos6搭建gitlab的方法步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
主要介绍了CentOS8.1搭建Gitlab服务器详细教程,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
Gitlab 在 8.0 后默认集成 CI 功能,相比 Hook 来说可以说是更加简单一些,可以省去在服务器自行书写 Hook 接收者的麻烦 但实际使用起来也踩了很多坑,在此记录并分享 环境配置 CentOS 7 + git + docker git 安装...
GitLab 是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的web服务。安装方法是参考GitLab在GitHub上的Wiki页面!新手必备文档,秒安装,秒使用,瞬间变大神!
在CentOS 7上进行完整安装生活在任何平台上的Docker容器您需要了解一些先决条件: 您将需要已安装mysql或mariadb并对其进行配置以进行网络访问您将需要以具有sudo访问权限(最好是sudo NOPASSWD访问权限)的用户...
本地centos虚拟机中部署jenkins+gitlab服务。可实现通过git推送代码到gitlab触发jenkins的自动构建。可以通过windows访问centos虚拟机中的jenkins和gitlab服务。还包括windows环境下的java,maven环境搭建,centos...
主要介绍了CentOS7下GitLab跨大版本升级的方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
基于centos 7.0平台搭建gitlab+jenkins可持续集成环境。
centos7 gitlab Omnibus 12 yum 安装.pdf 是我写的,有什么不懂可以留言
Centos7 操作系统部署汉化版gitlab,