1. 安装依赖软件
yum -y install policycoreutils policycoreutils-python openssh-server openssh-clients postfix
2.设置postfix开机自启,并启动,postfix支持gitlab发信功能
systemctl enable postfix && systemctl start postfix
3.下载gitlab安装包,然后安装
centos 7系统的下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
下载rpm包并安装:
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.1.1-ce.0.el7.x86_64.rpm
rpm -ivh gitlab-ce-11.1.1-ce.0.el7.x86_64.rpm
4.修改gitlab配置
vim /etc/gitlab/gitlab.rb
It looks like GitLab has not been configured yet; skipping the upgrade script.
*. *.
*** ***
***** *****
.****** *******
******** ********
,,,,,,,,,***********,,,,,,,,,
,,,,,,,,,,,*********,,,,,,,,,,,
.,,,,,,,,,,,*******,,,,,,,,,,,,
,,,,,,,,,*****,,,,,,,,,.
,,,,,,,****,,,,,,
.,,,***,,,,
,*,.
_______ __ __ __
/ ____(_) /_/ / ____ _/ /_
/ / __/ / __/ / / __ `/ __ \
/ /_/ / / /_/ /___/ /_/ / /_/ /
\____/_/\__/_____/\__,_/_.___/
Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
sudo gitlab-ctl reconfigure
指定服务器ip和自定义端口:
## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
external_url 'http://gitlab.xxx.io:8088'
5.重置并启动GitLab
执行:
gitlab-ctl reconfigure
gitlab-ctl restart
ok: run: alertmanager: (pid 28239) 1s
ok: run: gitaly: (pid 28249) 0s
ok: run: gitlab-monitor: (pid 28271) 1s
ok: run: gitlab-workhorse: (pid 28282) 0s
ok: run: logrotate: (pid 28294) 1s
ok: run: nginx: (pid 28301) 0s
ok: run: node-exporter: (pid 28351) 0s
ok: run: postgres-exporter: (pid 28357) 1s
ok: run: postgresql: (pid 28409) 0s
ok: run: prometheus: (pid 28417) 0s
ok: run: redis: (pid 28431) 1s
ok: run: redis-exporter: (pid 28456) 0s
ok: run: sidekiq: (pid 28484) 1s
ok: run: unicorn: (pid 28493) 0s
启动完成后即可访问
如果502错误通过 gitlab-ctl tail unicorn 检查日志