「GitLab」- 安装 GitLab CE 8.16.5 064dab1 版本 @20210311
# 03/08/2021 这是当年记录的 GitLab Community Edition 8.16.5 064dab1 安装笔记。
Download: https://about.gitlab.com/downloads/
Docs: https://docs.gitlab.com/ce/README.html
参考资料:http://www.oschina.net/news/50222/git-code-platforms 、http://www.oschina.net/p/gitlab
Install
https://about.gitlab.com/downloads/#ubuntu1604
OS: Ubuntu 16.04 x64
硬件要求: https://docs.gitlab.com/ce/install/requirements.html 请认真阅读;
1. Install and configure the necessary dependenciesm
如果安装 Postfix,安装时选择 'Internet Site' 。Sendmail 或者其他的 SMTP 服务器也可以;
HTTP 与 SSH ,火墙要放行;
> apt-get install curl openssh-server ca-certificates postfix
2. Add the GitLab package server and install the package
> curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
> apt-get install gitlab-ce
或者,自己安装:
> curl -LJO https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/xenial/gitlab-ce-XXX.deb/download
> dpkg -i gitlab-ce-XXX.deb
3. Configure and start GitLab
> gitlab-ctl reconfigure
4. Browse to the hostname and login
第一次访问的时候,会被重定向到管理员密码重置页面,输入密码之后,重定向到登录页面;
默认的账户名是 root,用之前设置的密码登录,登录之后可以修改用户名;
5. Run
启动 GitLab:
> gitlab-ctl start
ok: run: gitlab-workhorse: (pid 7792) 1023s
ok: run: logrotate: (pid 7806) 1023s
ok: run: nginx: (pid 7814) 1022s
ok: run: postgresql: (pid 7825) 1022s
ok: run: redis: (pid 7837) 1021s
ok: run: sidekiq: (pid 7852) 1019s
ok: run: unicorn: (pid 7876) 1017s
这就是尴尬的地方,GitLab 内置了 Nginx
6. With Nginx
可惜我的环境复杂一些,我本来就有 Nginx,请移步到 /var/opt/gitlab/nginx/conf 文件夹(至于怎么找到的不解释,ps、nginx -p),在 gitlab-http.conf 文件中:
** location ~ ^/(404|422|500|502)(-custom)?\.html$ {** ** root /opt/gitlab/embedded/service/gitlab-rails/public;** ** internal;** ** }**
暴露了源码位置,再次证明传闻 Ruby on Rails 所开发。
GitLab 中的 Nginx 会监听 2 个端口:80 和 8060。80主页,8060 是查看 Nginx 状态的;
如果要和原有的 Nginx 整合,合并配置文件,即可。
但是,我要偷懒,修改 GitLab Nginx 的监听端口改掉,使用 原nginx 的 proxy_pass,这个本文不介绍;
相关文章
「GitLab」- 升级 12.x 到 13.x 版本(容器部署)
「GitLab」- 安装社区版(CentOS 7)
参考文献
访问GitLab主页
Wikipedia/GitLab