安装gitlab
安装相关依赖:
yum -y install policycoreutils openssh-server openssh-clients postfix
启动ssh服务和设置ssh服务为开机启动:
systemctl enable sshd && sudo systemctl start sshd
查看是否开启:
systemctl status sshd
如果出现 Active: active (running)代表开启
设置postfix开机自启动,并启动postfix,postfix支持gitlab发邮件功能
systemctl enable postfix && systemctl start postfix
查看防火墙状态:systemctl status firewalld
如果是关闭就不需要下面一步,
开放ssh和http服务,再重启防火墙
firewall-cmd --add-service=ssh --permanent
firewall-cmd --add-service=http --permanent
firewall-cmd --reload
下载gitlab:
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
安装gitlab:
rpm -ivh gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
修改gitlab配置文件:
vim /etc/gitlab/gitlab.rb
改动:
external_url:'http://ip:port'
nginx['listen_port'] = port
重启gitlab:
gitlab-ctl reconfigure
gitlab-ctl restart
让防火墙开启刚才设置的端口并重启防火墙:82根据自己的值改动
让防火墙开放82端口:firewall-cmd --add-port=82/tcp --permanent
重新加载:firewall-cmd --reload
登陆gitlab:
http://ip:port 出现502要等一会,初次加载比较慢,进去后要先设置密码,再用root/new password登陆
浙公网安备 33010602011771号