1.安装ssh
sudo yum install -y curl policycoreutils-python openssh-server
2.将SSH服务设置成开机自启动,安装命令:
sudo systemctl enable sshd
3.启动SSH服务,安装命令:
sudo systemctl start sshd
4。安装防火墙(如果已经安装了防火墙并且已经在运行状态,则可直接进行第6步)
yum install firewalld systemd -y
5.开启防火墙,安装命令:
service firewalld start
6.添加http服务到firewalld,pemmanent表示永久生效,若不加–permanent系统下次启动后就会失效
sudo firewall-cmd --permanent --add-service=http
7.重启防火墙,安装命令:
sudo systemctl reload firewalld
8.接下来,安装Postfix以发送通知邮件,安装命令:
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
9.添加Gitlab包资源
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
10.执行Gitlab安装命令
sudo EXTERNAL_URL=“http://192.168.3.13:8081” yum install -y gitlab-ee
注意:EXTERNAL_URL设置的是本地IP和端口号,如果忘记修改,需要要主配置文件中修改,修改后通过gitlab-ctl reconfigure 命令生效
gitlab-ee通过国外网站下载,可能速度比较忙,可以多试几次。
下面是我挂云盘上面的地址,可以手工下载替换,避免下载
https://pan.baidu.com/s/1QdErGZQacwMamwnQMZloZg
11.登陆Gitlab系统,http://192.168.3.13:8081,首次修改密码
12.使用GitLab
常用目录 | 目录说明 |
---|---|
/etc/gitlab/gitlab.rb | 主配置文件 |
/var/log/gitlab/ | 日志目录 |
/var/opt/gitlab/ | 各个服务的主目录 |
/var/opt/gitlab/git-data/repositories | GIT仓库数据目录 |
常用命令:gitlab-ctl stop|start|restart|
修改主配置文件后,可以通过 gitlab-ctl reconfigure
13.SSH设置
ssh-keygen -o -t rsa -b 4096 -C "email@example.com"
拷贝到gitlab中
参考:
https://about.gitlab.com/install/#centos-7
https://blog.csdn.net/duyusean/article/details/80011540