centos 7部署gitlab

安装依赖

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

设置postfix开启自启并启动,postfix支持发信功能

systemctl enable postfix && systemctl start postfix

下载gitlab安装包,然后安装

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

报以下错:

warning: gitlab-ce-11.2.0-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
error: Failed dependencies:
        policycoreutils-python is needed by gitlab-ce-11.2.0-ce.0.el7.x86_64

解决办法:

yum install -y policycoreutils-python

再安装

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

配置gitlab配置文件,指定服务器ip和端口

sudo vi /etc/gitlab/gitlab.rb
#配置首页地址(大约在第10行)
external_url 'http://ip:端口'

重新加载配置并重启

gitlab-ctl reconfigure #等待一会
gitlab-ctl restart

查看端口占用情况

netstat -tunlp | grep "8081"

浏览器输入http://ip:端口,首次登陆请用root,设置密码

参考链接: https://my.oschina.net/u/3962987/blog/3063213

     https://www.cnblogs.com/yybrhr/p/9988835.html

     https://blog.51cto.com/andyxu/2427190

猜你喜欢

转载自www.cnblogs.com/2186009311CFF/p/12276020.html