一.安装并配置必要的依赖
[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 基本配置
[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 ~]# 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,进行重新配置才能生效。
[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