1.安装依赖环境
yum install -y curl policycoreutils-python openssh-server wget perl vim sudo zip
2.启动ssh并设置为开机自启动
systemctl enable sshd
systemctl start sshd
3.添加http/https服务到firewalld,pemmanent表示永久生效,若不加-permanent系统下次启动后就会失效
systemctl start firewalld
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
systemctl reload firewalld
4.在线下载gitlab
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-16.7.7-ce.0.el7.x86_64.rpm/download.rpm
5.安装
rpm -i gitlab-ce-16.7.7-ce.0.el7.x86_64.rpm
安装后时间要稍微等一会儿会出现图形界面
6.修改ip
vim /etc/gitlab/gitlab.rb
7.重新配置
gitlab-ctl reconfigure
此命令花费时间较长,耐心等待
8.重新启动
gitlab-ctl restart
9.访问
http://ip
第一次输入地址会报错502,再次输入就好了
并不知道账号密码,通过
cat /etc/gitlab/initial_root_password
及时更改密码,此密码24小时后过期
10.修改访问地址和端口
vim /etc/gitlab/gitlab.rb
gitlab-ctl reconfigure
firewall-cmd --zone=public --add-port=4567/tcp --permanent
firewall-cmd --reload
firewall-cmd --zone=public --list-ports
netstat -lnpt
gitlab-ctl restart