License: Attribution-NonCommercial-ShareAlike 4.0 International
本文出自 Suzf Blog。 如未注明,均为 SUZF.NET 原创。
由于 The Geate Wall 过于强大,有些时候不得不科学上网。 通过 rubygems & 官方 omnibus 也会出现种种问题。 踩坑无数,喜出望外的是发现了 清华大学 TUNA 镜像源 [https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/] # cat /etc/issue Ubuntu 16.04.1 LTS 这里以 Ubuntu 16.04.1 LTS 为例 其他版本可自行到 tsinghua tuna mirror 查看 首先信任 GitLab 的 GPG 公钥:
curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null
然后添加 tsinghua tuna mirrors
sudo echo "deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial main" > /etc/apt/sources.list.d/gitlab-ce.list
安装 gitlab-ce
# sudo apt-get update # sudo apt-get install gitlab-ce Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: gitlab-ce 0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded. Need to get 302 MB of archives. After this operation, 812 MB of additional disk space will be used. Get:1 https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial/main amd64 gitlab-ce amd64 8.12.0-ce.0 [302 MB] Fetched 302 MB in 56s (5,348 kB/s) Selecting previously unselected package gitlab-ce. (Reading database ... 58856 files and directories currently installed.) Preparing to unpack .../gitlab-ce_8.12.0-ce.0_amd64.deb ... Unpacking gitlab-ce (8.12.0-ce.0) ... Setting up gitlab-ce (8.12.0-ce.0) ... *. *. *** *** ***** ***** .****** ******* ******** ******** ,,,,,,,,,***********,,,,,,,,, ,,,,,,,,,,,*********,,,,,,,,,,, .,,,,,,,,,,,*******,,,,,,,,,,,, ,,,,,,,,,*****,,,,,,,,,. ,,,,,,,****,,,,,, .,,,***,,,, ,*,. _______ __ __ __ / ____(_) /_/ / ____ _/ /_ / / __/ / __/ / / __ `/ __ \ / /_/ / / /_/ /___/ /_/ / /_/ / \____/_/\__/_____/\__,_/_.___/ gitlab: Thank you for installing GitLab! gitlab: To configure and start GitLab, RUN THE FOLLOWING COMMAND: sudo gitlab-ctl reconfigure gitlab: GitLab should be reachable at http://git.suzf.net gitlab: Otherwise configure GitLab for your system by editing /etc/gitlab/gitlab.rb file gitlab: And running reconfigure again. gitlab: gitlab: For a comprehensive list of configuration options please see the Omnibus GitLab readme gitlab: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md gitlab: It looks like GitLab has not been configured yet; skipping the upgrade script. # dpkg -l| grep gitlab ii gitlab-ce 8.12.0-ce.0 amd64 GitLab Community Edition and GitLab CI (including NGINX, Postgres, Redis)
默认配置文件 /etc/gitlab/gitlab.rb 默认目录结构 Omnibus-gitlab uses four different directories. /opt/gitlab holds application code for GitLab and its dependencies. /var/opt/gitlab holds application data and configuration files that gitlab-ctl reconfigure writes to. /etc/gitlab holds configuration files for omnibus-gitlab. These are the only files that you should ever have to edit manually. /var/log/gitlab contains all log data generated by components of omnibus-gitlab. 初始化 GitLab sudo gitlab-ctl reconfigure 启用防火墙的80端口
sudo firewall-cmd --zone=public --permanent --add-rich-rule="rule family="ipv4" source address="172.16.9.0/24" port protocol="tcp" port="80" accept" success sudo firewall-cmd --reload
浏览器使用 gitlab 服务器的IP 访问测试,是否能打开gitlab 主页 默认管理账户为 root, 初次登陆会要求更改密码。
参考链接
[1] https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
[2] https://docs.gitlab.com/ce/install/installation.html
[3] https://docs.gitlab.com/ce/install/requirements.html
[4] http://www.linuser.com/forum.php?mod=viewthread&tid=1790&highlight=gitlab