Debian/Ubuntu 用户

首先信任 GitLab 的 GPG 公钥:

curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null

再选择你的 Debian/Ubuntu 版本,文本框中内容写进 /etc/apt/sources.list.d/gitlab-ce.list

Debian7(Wheezy)
echo "deb http://mirrors.lifetoy.org/gitlab-ce/debian wheezy main" | sudo tee -a /etc/apt/sources.list.d/gitlab-ce.list Debian8(Jessie)
echo "deb http://mirrors.lifetoy.org/gitlab-ce/debian jessie main" | sudo tee -a /etc/apt/sources.list.d/gitlab-ce.list Ubuntu 14.04 LTS
echo "deb http://mirrors.lifetoy.org/gitlab-ce/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list.d/gitlab-ce.list

安装Gitlab-CE:

sudo apt-get update
sudo apt-get install gitlab-ce

然后修改默认的域名:

sudo vim /etc/gitlab/gitlab.rb

但我在服务器上测试后发现不能正常访问,检查log后发现主要问题是:gitlab安装包自带了nginx,要使用80端口对外服务,同时unicorn要使用8080端口对内服务,但在我们的服务器上这两个端口都已经被占用了。

因此,解决办法是:修改nginx的默认端口为8000,指定unicorn的默认端口为8001,修改gitlab-shell的默认端口为8000。

vim /var/opt/gitlab/nginx/etc/gitlab-http.conf
将其中的listen *:80改为listen *:8000, vim /var/opt/gitlab/gitlab-rails/etc/unicorn.rb
将listen行的内容改为 :listen “127.0.0.1:8001”, :tcp_nopush => true 然后修改:/var/opt/gitlab/gitlab-shell/config.yml
gitlab_url: “http://127.0.0.1:8000” 最后执行:gitlab-ctl reconfigure

启动服务:gitlab-ctl start

停止服务:gitlab-ctl stop

重启服务:gitlab-ctl restart

查看日志

reids:gitlab-ctl tail -f redis

postgresql:gitlab-ctl tail -f postgresql

gitlab-workhorse:gitlab-ctl tail -f gitlab-workhorse

gitlab-ctl tail  -f logrotate

gitlab-ctl tail -f  nginx

gitlab-ctl tail -f sidekiq

gitlab-ctl tail -f unicorn

对于配置比较低的服务器暗转7.2.1

1、wget https://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.2.1-omnibus-1_amd64.deb

2、sudo apt-get install openssh-server

3、sudo apt-get install postfix

安装的时候选择local

4、sudo dpkg -i gitlab_7.2.1-omnibus-1_amd64.deb

5、sudo -vim /etc/gitlab/gitlab.rb

6、sudo gitlab-ctl reconfigure

安装可能会出现未安装 swap相关异常

先看看是否有swap分区

deploy@web03:~$ sudo swapon -s
[sudo] password for deploy:
Filename Type Size Used Priority

这样就是没有

也可以通过free命令

deploy@web03:~$ free -m
total used free shared buffers cached
Mem: 3951 504 3447 0 151 199
-/+ buffers/cache: 153 3798
Swap: 0 0 0

swap total是0

创建swapfile

sudo fallocate -l 4G /swapfile

设置/swapfile权限

sudo chmod 600 /swapfile

设置swapfile

sudo mkswap /swapfile

启用

sudo swapon /swapfile

查看

deploy@web03:~$ sudo swapon -s
[sudo] password for deploy:
Filename Type Size Used Priority
/swapfile file 1048572 0 -1

修改fstab

sudo vi /etc/fstab

添加

/swapfile   none    swap    sw    0   0

分区就创建完成了,再次重新安装gitlab应该不会有问题了

ubuntu 安装 gitlab最新版(下载慢问题)的更多相关文章

  1. ubuntu 安装 lrzsz 上传下载

    原文:ubuntu 安装 lrzsz 上传下载 版权声明:本文为博主原创文章,随意转载. https://blog.csdn.net/Michel4Liu/article/details/808223 ...

  2. ubuntu 安装transmission最新版

    访问 www.transmissionbt.com   下载最新版 1)下载transmission:#  wget https://transmission.cachefly.net/transmi ...

  3. Ubuntu安装uget和aria2下载工具

    Windows下的下载工具有迅雷,快车等.Ubuntu下也有强大的下载工具uget和aria2. 一.安装.uget和aria2都可以在“软件中心”中安装,但是版本太老啦,所以最好还是在终端中添加pp ...

  4. ubuntu安装gitlab

    #安装所有的依赖包 sudo apt-get install -y build-essential git-core sudo apt-get install -y zlib1g-dev libyam ...

  5. Ubuntu 安装配置最新版 PostgreSQL

    环境:Ubuntu Xenial (16.04)     !!! CentOS 参考这里 #安装 PostgreSQL sudo apt-get updatesudo apt-get upgradea ...

  6. Ubuntu安装Gitlab Runner

    第一步: 添加GitLab的官方存储库:    curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runne ...

  7. 英文版Ubuntu安装配置搜狗拼音输入法

    下载搜狗输入法 1 进入搜狗输入法官网,进入上面导航兰的 "输入法Linux版"   2 根据你安装的ubuntu是32位还是64位下载 END ubuntu安装搜狗输入法 1 进 ...

  8. Redis --> Ubuntu安装redis

    Ubuntu安装redis   一.下载安装 root@21ebdf03a086:/# apt-cache search redis root@21ebdf03a086:/# apt-get inst ...

  9. ubuntu安装jdk,maven,tomcat

    ubuntu16.04安装jdk8 -jdk 检查是否安装成功 java -version 出现如上信息即安装成功 安装maven,先去官网下载指定版本的maven,个人使用apache-maven- ...

随机推荐

  1. C 随机不重复元素~转

    随机产生不重复元素:如何高效产生m个n范围内的不重复随机数(m<=n) 如何产生不重复的随机数?最容易想到的方法,是逐个产生这些随机数,每产生一个,都跟前面的随机数比较,如果重复,就重新产生.这 ...

  2. java基础练习 19

    public class Ninetheen { /*求1+2!+3!+...+20!的和*/ public static void main(String[] args){ int i,j; lon ...

  3. HTTP GET与POST区别

    HTTP定义了与服务器交互的不同方法,最基本的方法是 GET 和 POST. HTTP-GET和HTTP-POST是使用HTTP的标准协议动词,用于编码和传送变量名/变量值对参数,并且使用相关的请求语 ...

  4. 【linux高级程序设计】(第十二章)Linux多线程编程 4

    读写锁 书上有读者写者的代码,我实在是懒得实现一遍了.跟之前的代码差不多. 多线程异步信号处理 int pthread_kill (pthread_t __threadid, int __signo) ...

  5. SqlServer高版本数据库数据备份到低版本数据库上

    想要将Sqlserver2014高版本备份的数据还原到低版本SqlServer2012上去,但是这在SqlServer中是没法直接还原数据库的,通过以下方法可以顺利还原. 通过高版本生成sql脚本在低 ...

  6. PostgreSQL备份和恢复数据表

    备份数据表: pg_dump -U user_name db_name -t table_name -f /tmp/backup_file.suffix 恢复数据表: 方法1: 登录数据库:\i /t ...

  7. 【微信】根据appid, secret, code获取用户基本信息

    function getUserInfo(){ $appid = "yourappid"; $secret = "yoursecret"; $code = $_ ...

  8. Codeforces Beta Round #4 (Div. 2 Only) C. Registration system【裸hash/map】

    C. Registration system time limit per test 5 seconds memory limit per test 64 megabytes input standa ...

  9. Codeforces Round #428 A. Arya and Bran【模拟】

    A. Arya and Bran time limit per test 1 second memory limit per test 256 megabytes input standard inp ...

  10. Binary Tree Maximum Path Sum - LeetCode

    Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequence ...