目录
一.安装依赖环境准备
yum install curl policycoreutils openssh-server openssh-clients
systemctl enable sshd
systemctl start sshd
yum install postfix
systemctl enable postfix
systemctl start postfix
systemctl stop firewalld
systemctl disable firewalld
二.官网安装
curl -sShttps://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash (官网安装具体可以看官网提供的命令)
yum install gitlab-ce
gitlab-ctl reconfigure(配置文件权限,安装数据库,时间比较长)
三.访问登录
1.访问
Gitlab地址:ip
cat /etc/gitlab/initial_root_password(密码位置,有时效性及时修改)
账号:root
密码:上面查询出的一串代码
2.修改密码
cd /opt/gitlab/bin/(进入目录)
gitlab-rails console(打开控制台)
u=User.find(1)(查询root用户)
u.password='root123456'(修改密码)
u.password_confirmation = 'root123456'(确认密码)
u.save!(保存)
exit(退出)
3.创建项目
四.推送秘钥
1.生成秘钥
ssh-keygen
cat ~/.ssh/id_rsa.pub (复制所有内容)
2.存放秘钥