centos7安装部署gitlab服务器

2019/07/15 更新

今天打算把git和lnmp环境分离出来,新装了一个gitlab。结果死活无法访问。

最后发现,装完Linux之后 没有把防火墙关掉,导致80端口访问不了

==============================

新加的骇客神条到了,内存也组了双通道8G。在足够充足的情况下,于是准备在之前的vm虚拟机上安装gitlab。

比较简单,先做下记录

步骤

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 第一步安装依赖
[root@localhost ~]# yum -y install policycoreutils openssh-server openssh-clients postfix

# 第二步设置postfix开机自启,并启动。(postfix是gitlab发送邮件的依赖)
[root@localhost ~]# systemctl enable postfix && systemctl start postfix

# 第三步下载gitlab安装包,然后安装
[root@localhost ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-8.0.0-ce.0.el7.x86_64.rpm
[root@localhost ~]# rpm -i gitlab-ce-8.0.0-ce.0.el7.x86_64.rpm

# 第四步修改gitlab配置文件指定服务器ip和自定义端口
[root@localhost ~]# vi /etc/gitlab/gitlab.rb

# 修改 external_url 为 "http://域名或者IP:端口号"的格式(本机的域名或者IP)
# 如果当前服务器的8080端口已被使用的话,还需要修改 unicorn['port'] = 任意一个未被占用的端口号
# 修改完后保存退出

# 第五步 重置并启动GitLab
[root@localhost ~]# gitlab-ctl reconfigure
[root@localhost ~]# gitlab-ctl restart

当出现以下提示时,则安装成功:

ok: run: gitlab-git-http-server: (pid 3922) 1s
ok: run: logrotate: (pid 3929) 0s
ok: run: nginx: (pid 3936) 1s
ok: run: postgresql: (pid 3941) 0s
ok: run: redis: (pid 3950) 0s
ok: run: sidekiq: (pid 3955) 0s
ok: run: unicorn: (pid 3961) 1s

参考

centos7安装部署gitlab服务器
我所遇到的GitLab 502问题的解决


评论区