aliyun服务器ubuntu 14.04安装gitlab 7.x笔记

1.(root)更换apt-get源 新建文件source.list,内容如下:

deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
cp /etc/apt/sources.list /etc/apt/sources.list.bak
cp sources.list /etc/apt/sources.list
apt-get update

2.(root)安装必要的包

apt-get install -y cmake build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl git-core openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev vim

3.(root)安装邮件服务器,默认设置即可

apt-get install -y postfix

4.(root)安装ruby,使用阿里的ruby源可以节省下载时间 这里有修改,主要是ruby-1.9.3对commit删除记录有版本问题,会引发http500问题

mkdir /tmp/ruby && cd /tmp/ruby
curl --progress https://ruby.taobao.org/mirrors/ruby/2.1/ruby-2.1.2.tar.gz | tar xz
cd ruby-2.1.2
./configure
make
make install

5.(root)安装bundler,为了节省时间,记得更换ruby源

gem sources --remove http://rubygems.org/
gem sources -a http://ruby.taobao.org/
gem install bundler

6.(root)添加git用户

adduser --disabled-login --gecos 'GitLab' git

备注:从root用户切换到git用户:su git,退出git返回到root用户:exit

7.(git)安装gitlab-shell

su git
cd /home/git
git clone https://github.com/gitlabhq/gitlab-shell.git
cd gitlab-shell
git checkout v2.0.1
cp config.yml.example config.yml

只需要修改gitlab_url,注意跟你以后clone,pull,push的域名一致

vim config.yml

启动

./bin/install

8.(root)安装MySQL

apt-get install -y mysql-server mysql-client libmysqlclient-dev
mysql -u root -p
创建指定mysql账户
mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY 'gitlab';

创建数据库
mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

授权
mysql> GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON gitlabhq_production.* TO 'gitlab'@'localhost';

9.(git)安装gitlab主程序

cd /home/git
git clone https://github.com/gitlabhq/gitlabhq.git gitlab
cd /home/git/gitlab
git checkout 7-3-stable
cp config/gitlab.yml.example config/gitlab.yml

修改host即可,创建新用户和新项目时提示的地址来自这里,运行时没有影响

vim config/gitlab.yml

sudo chown -R git log/
sudo chown -R git tmp/
sudo chmod -R u+rwX  log/
sudo chmod -R u+rwX  tmp/

mkdir /home/git/gitlab-satellites
chmod u+rwx,g=rx,o-rwx /home/git/gitlab-satellites
chmod -R u+rwX tmp/pids/
chmod -R u+rwX tmp/sockets/
chmod -R u+rwX  public/uploads/
cp config/unicorn.rb.example config/unicorn.rb

git配置

git config --global user.name "GitLab"
git config --global user.email "gitlab@localhost"
cp config/database.yml.mysql config/database.yml

修改MySQL数据库配置

vim config/database.yml

10.(git)安装Gems

cd /home/git/gitlab

修改Bundle源地址为taobao, 首行改成 source 'http://ruby.taobao.org/'

vim Gemfile

只安装部署模式下的mysql配置,其他排除

bundle install --deployment --without development test postgres

11.(git)初始化数据数据库

bundle exec rake gitlab:setup RAILS_ENV=production

12.(git)检测一下安装状态

bundle exec rake gitlab:check RAILS_ENV=production

13.(root)安装init脚本

cd /home/git/gitlab
cp lib/support/init.d/gitlab /etc/init.d/gitlab
cp lib/support/init.d/gitlab.default.example /etc/default/gitlab
update-rc.d gitlab defaults 21

14.(git)编译静态资源

cd /home/git/gitlab
bundle exec rake assets:precompile RAILS_ENV=production

15.(root)启动gitlab

service gitlab start

以下添加nginx 配置 1.(root)安装nginx

apt-get install nginx

2.(root)添加gitlab的nginx配置文件

cd /home/git/gitlab
cp lib/support/nginx/gitlab /etc/nginx/sites-available/gitlab
ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab

替换YOUR_SERVER_FQDN

vim /etc/nginx/sites-available/gitlab

3.(root)检查配置文件格式并重启测试

sudo nginx -t
sudo service nginx restart

16.(git)再次测试

cd /home/git/gitlab
bundle exec rake gitlab:check RAILS_ENV=production

完成,登录网页试试,初始用户名密码: root/5iveL!fe

转载于:https://my.oschina.net/rst/blog/478648

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
信息数据从传统到当代,是一直在变革当中,突如其来的互联网让传统的信息管理看到了革命性的曙光,因为传统信息管理从时效性,还是安全性,还是可操作性等各个方面来讲,遇到了互联网时代才发现能补上自古以来的短板,有效的提升管理的效率和业务水平。传统的管理模式,时间越久管理的内容越多,也需要更多的人来对数据进行整理,并且数据的汇总查询方面效率也是极其的低下,并且数据安全方面永远不会保证安全性能。结合数据内容管理的种种缺点,在互联网时代都可以得到有效的补充。结合先进的互联网技术,开发符合需求的软件,让数据内容管理不管是从录入的及时性,查看的及时性还是汇总分析的及时性,都能让正确率达到最高,管理更加的科学和便捷。本次开发的高校科研信息管理系统实现了操作日志管理、字典管理、反馈管理、公告管理、科研成果管理、科研项目管理、通知管理、学术活动管理、学院部门管理、科研人员管理、管理员管理等功能。系统用到了关系型数据库中王者MySql作为系统的数据库,有效的对数据进行安全的存储,有效的备份,对数据可靠性方面得到了保证。并且程序也具备程序需求的所有功能,使得操作性还是安全性都大大提高,让高校科研信息管理系统更能从理念走到现实,确确实实的让人们提升信息处理效率。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值