Welcome 微信登录

首页 / 操作系统 / Linux / 在CentOS里安装GitLab

把我最近研究的gitlab如何在CentOS里安装的笔记分享给大家。先给大家介绍一下gitlabGitLab 是一个用于仓库管理系统的开源项目。使用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与基础依赖库及软件
1234cd /tmpwget http://download.Fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpmrpm -Uvh epel-release-6-8.noarch.rpmyum 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以上)
12345678910mkdir /tmp/ruby && cd /tmp/rubycurl --progress http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz | tar xzcd ruby-1.9.3-p392/./configuremakemake installgem install bundlerln -s /usr/local/bin/ruby /usr/bin/rubyln -s /usr/local/bin/gem /usr/bin/gemln -s /usr/local/bin/bundle /usr/bin/bundle
3、创建一个git用户供GitLab使用 
12adduser --comment "GitLab" gitchmod –R 755 /home/git
4、安装gitlab 的shell 
123456789101112131415# Login as gitsudo su git# Go to home directorycd /home/git# Clone gitlab shellgit clone https://github.com/gitlabhq/gitlab-shell.gitcd gitlab-shell# switch to right versiongit checkout v1.3.0cp 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数据库并授权
12345678910# Login to MySQLmysql -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 databasemysql> 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 sessionmysql> q
6、克隆gitlab源
1234567891011121314151617181920212223242526272829303132333435# Clone GitLab repositorycd /home/gitsudo -u git -H git clone https://github.com/gitlabhq/gitlabhq.git gitlab# Go to gitlab dircd /home/git/gitlab# Checkout to stable releasesudo -u git -H git checkout 5-1-stableConfigure itcd /home/git/gitlab# Copy the example GitLab configsudo -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 necessarysudo -u git -H vim config/gitlab.yml# Make sure GitLab can write to the log/ and tmp/ directoriessudo chown -R git log/sudo chown -R git tmp/sudo chmod -R u+rwX log/sudo chmod -R u+rwX tmp/# Create directory for satellitessudo -u git -H mkdir /home/git/gitlab-satellites# Create directories for sockets/pids and make sure GitLab can write to themsudo -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 failsudo -u git -H mkdir public/uploadssudo chmod -R u+rwX public/uploads# Copy the example Puma configsudo -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.ymlsudo -u git -H git config --global user.name "GitLab"sudo -u git -H git config --global user.email "gitlab@localhost"
  • 1
  • 2
  • 下一页
又一个Linux的双向stateless NAT搭建Qt5.1.0 Beta的Android开发环境相关资讯      Gitlab  CentOS GitLab 
  • GitLab发布新工具GitLab问题看板,  (今 16:04)
  • GitLab v 8.8.5 发布下载,项目管  (06月17日)
  • GitLab联合DigitalOcean为开源社区  (05月08日)
  • GitLab v8.9.4, v8.8.7社区版和 v8  (07月05日)
  • GitLab v8.8.3 发布下载,项目管理  (06月03日)
  • Fedora 23下Gitlab服务器搭建  (02月29日)
本文评论 查看全部评论 (0)
表情: 姓名: 字数


评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并