在centos7上安装GitLab
- 安装相关依赖
yum -y install policycoreutils openssh-server openssh-clients postfix
2.启动postfix,并设置开机自启动
目的:支持gitlab邮件发送
systemctl enable postfix && systemctl start postfix
如果报错:Job for postfix.service failed because the control process exited with error code. See "systemctl status postfix.service" and "journalctl -xe" for details.
修改 /etc/postfix/main.cf的设置 即可
inet_protocols = ipv4
inet_interfaces = all
3.下载安装包
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.5.2-ce.0.el7.x86_64.rpm
4.安装命令
rpm -ivh gitlab-ce-10.5.2-ce.0.el7.x86_64.rpm
如果报错:
安装gitlab依赖后重新安装
yum install policycoreutils-python
5.修改gitlab配置文件
vi /etc/gitlab/gitlab.rb
修改external_url参数,例如服务器ip地址为10.0.19.32
external_url='http://10.211.55.10'
有端口,则放到后面即可
6.因为修改了配置文件,所以重新加载配置文件
gitlab-ctl reconfigure
7.重启gitlab服务
gitlab-ctl restart
8.Web页面配置
由于服务器IP 地址为 10.0.19.32而且gitlab 默认的端口号为 80,所以使用浏览器访问以下地址:
http:// 10.0.19.32:80
注意:可能会报错502
首先保证Gitlab可用运行内存大于4G,端口未被占用
再赋予权限:chmod -R 755 /var/log/gitlab
再重置重启
9.默认用户名和密码
root 和5iveL!fe