CentOS 7安装部署GitLab服务器

下面方法不行,则用该链接方法部署:https://ken.io/note/centos7-gitlab-install-tutorialnode

1. 安装依赖软件linux

yum -y install policycoreutils openssh-server openssh-clients postfixnginx

2.设置postfix开机自启,并启动,postfix支持gitlab发信功能git

systemctl enable postfix && systemctl start postfixredis

3.下载gitlab安装包,而后安装sql

centos 6系统的下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6vim

centos 7系统的下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7centos

个人是centos7,因此我在https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7中找了个gitlab8.0.0版本,建议下载一个比较新的版本,我这里选了一个比较旧的版本仅仅是实验服务器

下载rpm包并安装:ssh

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.2.0-ce.0.el7.x86_64.rpm

rpm -i gitlab-ce-11.2.0-ce.0.el7.x86_64.rpm

4.修改gitlab配置文件指定服务器ip和自定义端口:

vim  /etc/gitlab/gitlab.rb

退出并保存

ps:注意这里设置的端口不能被占用,默认是8080端口,若是8080已经使用,请自定义其它端口,并在防火墙设置开放相对应得端口(若是端口被占领

netstat -tunlp | grep "8080"
# netstat -tunlp | grep 8000
tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN      26993/nodejs

5.重置并启动GitLab

执行:

gitlab-ctl reconfigure

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

提示“ok: run:”表示启动成功

6.访问 GitLab页面

若是没有域名,直接输入服务器ip和指定端口进行访问(localhost:8080)

参考网址:https://www.linuxidc.com/Linux/2017-06/144990.htm

相关文章
相关标签/搜索