1. 安装4个相关依赖
yum -y install policycoreutils-python openssh-server openssh-clients postfix
查看是否安装成功
rpm -qa|grep openssh
rpm -qa|grep postfix
rpm -qa|grep policycoreutils-python
2. 启动postfix,并设置开机自启动
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.
vim /etc/postfix/main.cf
修改配置如下图
3. 配置ssh服务
systemctl enable sshd
systemctl start sshd
systemctl status sshd
systemctl status firewalld 查看防火墙有没有启动,没有就启动
将http服务策略添加到防火墙
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
systemctl status postfix 查看postfix有没有启动,没有就启动
4. 下载rpm包并安装
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-13.1.2-ce.0.el7.x86_64.rpm
rpm -i gitlab-ce-13.1.2-ce.0.el7.x86_64.rpm
出现这个说明安装成功
5. 配置gitlab
vim /etc/gitlab/gitlab.rb
阿里云记得开放端口,防火墙也要开放
firewall-cmd --zone=public --add-port=端口号/tcp --permanent
改完后重置并启动gitlab
gitlab-ctl reconfigure
gitlab-ctl start
如果再次修改gitlab.rb配置,先停止 gitlab-ctl stop
并且修改后也要重置gitlab,gitlab-ctl reconfigure
再启动
6. 页面报错502