如何把linuxlinux centos 6.4安装6.4中配置gitlab服务器方法

CENTOS 安装GITLAB笔记_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
CENTOS 安装GITLAB笔记
上传于||暂无简介
阅读已结束,如果下载本文需要使用0下载券
想免费下载更多文档?
定制HR最喜欢的简历
下载文档到电脑,查找使用更方便
还剩10页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢搭建 Linux 下 GitLab 服务器_服务器应用_Linux公社-Linux系统门户网站
你好,游客
搭建 Linux 下 GitLab 服务器
来源:Linux社区&
作者:passion_wu128
这两天因为项目需求需要搭建一个GitLab服务器,遇到了很多问题,参考了很多网络资料,终于搭建成功,在此把这个过程记录一下,利人利己。
&一、最终目的
1,在Linux下创建GitLab服务器,客户端能够完成git 的 clone,pull,commit,push操作。
2,能够通过浏览器访问服务器上的GitLab主页,登录之后能够实现,创建工程,增加用户等操作。
二、准备知识
虽然按照后续过程能够实现最终目的,但本人强烈建议读者大致了解下以下知识点。(本人就是因为事先对有些知识不了解导致搭建过程中困难重重)
& & & 1,git的基本用法
2,gitolite和github
3,ssh认证
4,uginx代理服务器
三、搭建环境
& & & 服务器:
11.04(本人使用的是虚拟机),需要已经启动了ssh服务。
& & & 测试客户端:Win7,需要先安装git
四、开始搭建
平台需求:
此项目被设计用于Linux操作系统。
也许可以工作在 FreeBSD 与 Mac OS 系统,但我们无法保证系统稳定性与功能完整性。
官方支持的 Linux 发行版:
Ubuntu LinuxDebian/GNU Linux它应该工作于:
你使用这些系统需要些运气,但不保证稳定性:
MacOS XFreeBSDGitLab 不能运行于 Windows 并且我们也没有支持的计划。
硬件需求:我们推荐至少 1GB 内容用于 gitlab 实例。
本安装指南已于 Debian/Ubuntu 测试通过。安装总共需要6步:安装依赖包安装 Ruby安装 Gitolite安装与配置 GitLab启动前端Web服务器启动Resque进行(用于后台任务)重要信息在你发邮件列表询问安装与配置问题之前请确认你已经根据本文完成了所有步骤。
Only create a GitHub Issue if you want a specific part of this installation guide updated.
Also read the Read this before you submit an issue wiki page.
使用这个安装脚本可以轻易的跳过前3个步骤。
# 安装 curl 与 sudoapt-get install curl sudo
# 三合一命令 :)curl /gitlabhq/gitlab-recipes/master/install/debian_ubuntu.sh | sh现在你可以直接到到第四步
如果你在 Amazon Web Services 使用 Ubuntu 12.04,你可以使用一个命令跳过所有步骤(1-6)
curl /gitlabhq/gitlab-recipes/master/install/debian_ubuntu_aws.sh | sh
更多详细信息,你可以阅读的 HOWTO 部分。
笔者注:本人使用了三合一命令欲跳过前三步,但后续安装怎么都不成功,后来才发现第二步安装有问题,按照第2步要求安装ruby就可以了。
所以请关注这个三个一命令状态,确保都能执行成功。
1. 安装依赖包请记住,Debian 默认并没有安装 sudo,请使用 root 安装它:
apt-get update && apt-get upgrade && apt-get install sudo现在你可以安装必须包:
sudo apt-get updatesudo apt-get upgrade
sudo apt-get install -y wget curl gcc checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libreadline6-dev libc6-dev libssl-dev libmysql++-dev make build-essential zlib1g-dev libicu-dev redis-server openssh-server git-core python-dev python-pip libyaml-dev postfix libpq-dev数据库SQLitesudo apt-get install -y sqlite3 libsqlite3-devMySQLsudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
# Login to MySQL$ mysql -u root -p
# Create the GitLab production databasemysql& CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
# Create the MySQL User change $password to a real passwordmysql& CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password';
# Grant proper permissions to the MySQL Usermysql& GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost';PostgreSQLsudo apt-get install -y postgresql-9.2 postgresql-server-dev-9.2
# Connect to database serversudo -u postgres psql -d template1
# Add a user called gitlab. Change $password to a real passwordtemplate1=# CREATE USER gitlab WITH PASSWORD '$password';
# Create the GitLab production databasetemplate1=# CREATE DATABASE IF NOT EXISTS gitlabhq_
# Grant all privileges on databasetemplate1=# GRANT ALL PRIVILEGES ON DATABASE gitlabhq_
# Quit from PostgreSQL servertemplate1=# \q
# Try connect to new database$ su - gitlab$ psql -d gitlabhq_production -U gitlab(译者注:以上3种数据库根据需要安装其一即可)
相关资讯 & & &
& (06月17日)
& (06月03日)
& (07月05日)
& (06月03日)
& (05月31日)
   同意评论声明
   发表
尊重网上道德,遵守中华人民共和国的各项有关法律法规
承担一切因您的行为而直接或间接导致的民事或刑事法律责任
本站管理人员有权保留或删除其管辖留言中的任意内容
本站有权在网站内转载或引用您的评论
参与本评论即表明您已经阅读并接受上述条款微信公众号:centoscn
CentOS6.4安装gitlab
&&&&系统:CentOS6.4最小化安装
&&&&IP:192.168.3.44
二、增加yum源
&&&&增加epel源
[root@gitlab&~]
Retrieving&http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
warning:&/var/tmp/rpm-tmp.YSifux:&Header&V3&RSA/SHA256&Signature,&key&ID&:&NOKEY
Preparing...&&&&&&&&&&&&&&&&
&&&1:epel-release&&&&&&&&&&&
[root@gitlab&~]
[root@gitlab&~]
&&&&安装淘宝源
[root@gitlab&~]
三、安装更新包
[root@gitlab&~]
[root@gitlab&~]
[root@gitlab&~]
四、安装git
&&&&删除系统默认的git,使用源码安装git
[root@gitlab&~]
git&version&1.7.1
[root@gitlab&~]
[root@gitlab&~]
[root@gitlab&~]
[root@gitlab&~]
[root@gitlab&git-2.1.3]
[root@gitlab&git-2.1.3]
[root@gitlab&git-2.1.3]
[root@gitlab&git-2.1.3]
git&version&2.1.3
五、安装ruby环境
&&&&删除系统自带的ruby环境
[root@gitlab&~]
[root@gitlab&~]
[root@gitlab&~]
[root@gitlab&~]
[root@gitlab&ruby-2.1.2]
[root@gitlab&ruby-2.1.2]
&&&&安装bundler
[root@gitlab&ruby-2.1.2]
[root@gitlab&ruby-2.1.2]
/usr/local/bin/ruby
[root@gitlab&ruby-2.1.2]
ruby&2.1.2p95&(&revision&45877)&[x86_64-linux]
六、创建git用户
[root@gitlab&~]
&&&&添加sudo权限
[root@gitlab&~]
git&&&&&ALL=(ALL)&&&&&&&NOPASSWD:&ALL
七、安装mysql,这里选择源码安装mysql-5.5-37,使用安装脚本进行安装
&&&&脚本内容如下
#!/bin/bash
DATADIR='/data/mysql/data'
VERSION='mysql-5.5.37'
export&LANG=zh_CN.UTF-8
.&/etc/init.d/functions
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
&&&&&&&&chown&-R&mysql.mysql&$DATADIR
&&&&&&&&cd
&&&&&&&&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
&&&&&&&&ln&-s&/usr/local/$VERSION/&/usr/local/mysql
&&&&&&&&ln&-s&/usr/local/mysql/bin/*&/usr/bin/
&&&&&&&&/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
&&&&&&&&/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
&&&&&&&&/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&&
&&&&&&&&if&[&$?&-eq&0&];then
&&&&&&&&&&&&&&&&echo&&+---------------------------+&
&&&&&&&&&&&&&&&&echo&&+------mysql安装完成--------+&
&&&&&&&&&&&&&&&&echo&&+---------------------------+&
&&&&&&&&fi
install_mysql
&&&&查看mysql安装结果
[root@gitlab&~]
mysql&&Ver&14.14&Distrib&5.5.37,&for&Linux&(x86_64)&using&&EditLine&wrapper
&&&&创建数据库并授权
[root@gitlab&~]
Enter&password:&&&&&&&&&
Welcome&to&the&MySQL&monitor.&&Commands&end&with&;&or&\g.
Your&MySQL&connection&id&is&6
Server&version:&5.5.37&Source&distribution
Copyright&(c)&,&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
Type&''&or&'\h'&for&help.&Type&'\c'&to&clear&the&current&input&statement.
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&&GRANT&SELECT,&LOCK&TABLES,&INSERT,&UPDATE,&DELETE,&CREATE,&DROP,&INDEX,&ALTER&ON&`gitlabhq_production`.*&TO&'git'@'localhost'&IDENTIFIED&BY&'gitpwd';
Query&OK,&0&rows&affected&(0.00&sec)
mysql&&flush&
Query&OK,&0&rows&affected&(0.01&sec)
mysql&&select&user,host,password&from&mysql.
+------+-----------+-------------------------------------------+
|&user&|&host&&&&&&|&password&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&|
+------+-----------+-------------------------------------------+
|&root&|&localhost&|&*B181A5BCA7CB8F6FEDDB&|
|&root&|&127.0.0.1&|&*B181A5BCA7CB8F6FEDDB&|
|&git&&|&localhost&|&*6EA0EDE421A05E610ADBFC5D47B93B6E06C6216F&|
+------+-----------+-------------------------------------------+
3&rows&in&set&(0.00&sec)
&&&&测试新建的用户能否登陆mysql
[root@gitlab&~]
Enter&password:&&&&&&&&&
Welcome&to&the&MySQL&monitor.&&Commands&end&with&;&or&\g.
Your&MySQL&connection&id&is&8
Server&version:&5.5.37&Source&distribution
Copyright&(c)&,&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
Type&''&or&'\h'&for&help.&Type&'\c'&to&clear&the&current&input&statement.
mysql&&show&
+---------------------+
|&Database&&&&&&&&&&&&|
+---------------------+
|&information_schema&&|
|&gitlabhq_production&|
|&test&&&&&&&&&&&&&&&&|
+---------------------+
3&rows&in&set&(0.00&sec)
八、配置redis
[root@gitlab&~]
[root@gitlab&~]
Starting&redis-server:&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&[&&OK&&]
[root@gitlab&~]
tcp&&&&&&&&0&&&&&&0&127.0.0.1:6379&&&&&&&&&&&&&&0.0.0.0:*&&&&&&&&&&&&&&&&&&&LISTEN&&&&&&8755/redis-server
九、安装gitlab
[root@gitlab&~]
[root@gitlab&git]
Cloning&into&'gitlab'...
remote:&Counting&objects:&127971,&done.
remote:&Compressing&objects:&100%&(32073/32073),&done.
remote:&Total&127971&(delta&97845),&reused&123442&(delta&94050)
Receiving&objects:&100%&(127971/127971),&81.35&MiB&|&1.63&MiB/s,&done.
Resolving&deltas:&100%&(97845/97845),&done.
Checking&connectivity...&done.
[root@gitlab&gitlab]
[root@gitlab&gitlab]
[root@gitlab&gitlab]
[root@gitlab&gitlab]
[root@gitlab&gitlab]
[root@gitlab&gitlab]
[root@gitlab&gitlab]
[root@gitlab&gitlab]
[root@gitlab&gitlab]
[root@gitlab&gitlab]
[root@gitlab&gitlab]
编辑配置文件unicorn.rb
[root@gitlab&gitlab]
[root@gitlab&gitlab]
[root@gitlab&gitlab]
worker_processes&1
[root@gitlab&gitlab]
[root@gitlab&gitlab]
[root@gitlab&gitlab]
[root@gitlab&gitlab]
[root@gitlab&gitlab]
[root@gitlab&gitlab]
development:&redis://localhost:6379
test:&redis://localhost:6379
production:&unix:/var/run/redis/redis.sock
十、编辑gitlab数据库文件
[root@gitlab&gitlab]
[root@gitlab&gitlab]
production:
&&adapter:&mysql2
&&encoding:&utf8
&&collation:&utf8_general_ci
&&reconnect:&false
&&database:&gitlabhq_production
&&pool:&10
&&username:&git
&&password:&&gitpwd&
[root@gitlab&gitlab]
十一、安装gem
[root@gitlab&gitlab]
[root@gitlab&gitlab]
[root@gitlab&gitlab]
[root@gitlab&~]
https://rubygems.org/&removed&from&sources
[root@gitlab&~]
http://ruby.taobao.org/&added&to&sources
[root@gitlab&~]
***&CURRENT&SOURCES&***
http://ruby.taobao.org/
------分隔线----------------------------Centos 6.5安装Gitlab版本管理 - Linux服务器 - 次元立方网 - 电脑知识与技术互动交流平台
Centos 6.5安装Gitlab版本管理
参考文档:/downloads/#centos61.安装Postfix和openssh软件[root@node1&~]#&yum&install&curl&openssh-server&openssh-clients&postfix&cronie[root@node1&~]#&service&postfix&start[root@node1&~]#&chkconfig&postfix&on[root@node1&~]#&lokkit&-s&http&-s&ssh2.安装Gitlab服务和包[root@node1&~]#&curl&-sS&/install/repositories/gitlab/gitlab-ce/script.rpm.sh&|&sudo&bash[root@node1&~]#&yum&install&gitlab-ce[root@node1&~]#&curl&-LJO&/gitlab/gitlab-ce/packages/el/6/gitlab-ce-XXX.rpm/download[root@node1&~]#&rpm&-i&gitlab-ce-XXX.rpm3.启动Gitlab服务[root@node1&~]#&gitlab-ctl&reconfigure4.打开首页http://IP/profileUsername:&rootPass:&5iveL!fe
延伸阅读:
大家好!这是一篇介绍如何在服务器或个人电脑上从MyS...
本教程为 李华明 编著的iOS-Cocos2d游戏开发系列教程:教程涵盖关于i......
专题主要学习DirectX的初级编程入门学习,对Directx11的入门及初学者有......
&面向对象的JavaScript&这一说法多少有些冗余,因为JavaScript 语言本......
Windows7系统专题 无论是升级操作系统、资料备份、加强资料的安全及管......

我要回帖

更多关于 linux centos6.4 的文章

 

随机推荐