安装相关的依赖
[root@git-server ~]# yum -y install postfix curl policycoreutils-python openssh-server
上传gitlab包
安装包可自行到官网下载 http://gitlab.com
[root@git-server ~]# rz
[root@git-server ~]# ls
gitlab-ce-12.6.3-ce.0.el7.x86_64.rpm
安装gitlab
[root@git-server ~]# rpm -ivh gitlab-ce-12.6.3-ce.0.el7.x86_64.rpm
warning: gitlab-ce-12.6.3-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:gitlab-ce-12.6.3-ce.0.el7 ################################# [100%]
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
For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
配置gitlab登录链接
[root@git-server ~]# cd /etc/gitlab/
[root@git-server gitlab]# ls
gitlab.rb
[root@git-server gitlab]# vim gitlab.rb
external_url 'http://192.168.234.104' 对外提供服的公网ip
gitlab_rails['time_zone'] = 'Asia/Shanghai' 修改时区
gitlab_rails['gitlab_shell_ssh_port'] = 22 开启ssh服务
git_data_dirs({
"default" => {
"path" => "/mnt/nfs-01/git-data" 数据路径
}
})
重新加载gitlab
[root@git-server gitlab]# gitlab-ctl reconfigure
重启gitlab
[root@git-server gitlab]# gitlab-ctl restart
访问测试
公网ip http://192.168.234.104