一、满足需要的环境
1.如果服务器需要开启防火墙,那就将添加http服务到firewalld,pemmanent表示永久生效
sudo firewall-cmd --permanent --add-service=http
重启防火墙:sudo systemctl reload firewalld
2.安装Postfix以发送通知邮件
安装命令:sudo yum install postfix (按enter键继续)
启动postfix:sudo systemctl start postfix
postfix服务设置成开机自启动:sudo systemctl enable postfix
二、安装GitLab服务器
1.安装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
安装成功:
2.修改GitLab配置文件
vim /etc/gitlab/gitlab.rb
external_url 'http://localhost:9090' #外部访问URL
unicorn['listen'] = '127.0.0.1' #unicorn默认监控IP
unicorn['port'] = 8008 #unicorn默认使用端口,默认8080,如果冲突则可修改成其余端口。
3.重置并启动GitLab
gitlab-ctl reconfigure
gitlab-ctl restart
启动成功:
三、访问GitLab页面
进去后会提醒你重新设置密码,用户名默认为:root
四、可能出现的问题
1.注意使用的端口是否被占用
2.如果出现莫名其妙的问题,那么可以尝试重启gitlab-ctl restart
3.报502,GitLab官网指定内存需要4G以上
4.初始登陆没有提示,尝试使用
账户:root
密码:5iveL!fe
5.防火墙也有可能是这个 iptables
永久关闭防火墙:chkconfig iptables off
五、延展
如果需要GitLab初始化一个项目的详解,那么可以前往
https://blog.csdn.net/csdnmhr/article/details/99413736