centos7安装gitlab

一.安装并配置必要的依赖
[root@localhost ~]# sudo yum install curl policycoreutils openssh-server openssh-clients 
[root@localhost ~]# sudo systemctl enable sshd 
[root@localhost ~]# sudo systemctl start sshd 
[root@localhost ~]# sudo yum install postfix 
[root@localhost ~]# sudo systemctl enable postfix 
[root@localhost ~]# sudo systemctl start postfix 
[root@localhost ~]# sudo firewall-cmd --permanent --add-service=http 
[root@localhost ~]# sudo systemctl reload firewalld

二.添加GitLab包服务器并安装包
[root@localhost ~]# curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash 
[root@localhost ~]# sudo yum install gitlab-ce

三.GitLab 基本配置

GitLab 的相关参数配置都存在 /etc/gitlab/gitlab.rb 文件里,每次配置完成之后需要执行gitlab-ctl reconfigure,进行重新配置才能生效。


进入编辑gitlab.rb文件
[root@localhost ~]# vim /etc/gitlab/gitlab.rb

执行修改的配置
[root@localhost ~]# sudo gitlab-ctl reconfigure
注意事项:
如果中间出现“红色”error,那可能执行失败。

默认配置前面有“#”,是被注释的,需要删除最前面的“#”


过程中出现的问题:

问题1:
[root@localhost ~]# sudo 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.
解决方案:
查看centos中的postfix日志
[root@localhost ~]# whereis postfix
postfix: /usr/sbin/postfix /etc/postfix /usr/libexec/postfix /usr/share/man/man1/postfix.1.gz
[root@localhost ~]# vim /etc/postfix/main.cf

发现配置为:
inet_interfaces = localhost
inet_protocols = all
改成:
inet_interfaces = all
inet_protocols = all

保存修改内容,重新启动postfix:
[root@localhost ~]# service postfix start   //或者 
[root@localhost ~]# /bin/systemctl start postfix.service

问题2:
[root@izhp3g5cu4i6tgupbshny5z ~]# sudo firewall-cmd --permanent --add-service=http 
FirewallD is not running

解决方案::
通过systemctl status firewalld查看firewalld状态,发现当前是dead状态,即防火墙未开启;显示running即已开启了。
[root@localhost ~]# systemctl status firewalld  //查看防火墙状态
[root@localhost ~]# systemctl start firewalld   //开启防火墙

[root@localhost ~]# systemctl status firewalld


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值