1、安装工具
sudo yum install curl policycoreutils openssh-server openssh-clients
sudo systemctl enable sshd sudo systemctl start sshd sudo yum install postfix sudo systemctl enable postfix sudo systemctl start postfix sudo firewall-cmd --permanent --add-service=http sudo systemctl reload firewalld
2、把镜像源更改为国内清华大学的
新建
/etc/yum.repos.d/gitlab-ce.repo
,内容为
[gitlab-ce] name=gitlab-ce baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7 repo_gpgcheck=0 gpgcheck=0 enabled=1 gpgkey=
https://packages.gitlab.com/gpg.key
再执行
sudo yum makecache sudo yum install gitlab-ce
3.更新配置
sudo gitlab-ctl reconfigure
把目录 的权限改成775
chmod -R 775 /etc/gitlab
chmod -R 775 /var/opt/gitlab
chmod -R 775 /opt/gitlab/embedded/etc
4.修改
gitlab.rb配置文件
vi /etc/gitlab/gitlab.rb
把extern_url改成ip或域名,如下图:
5.然后再重新执行
sudo gitlab-ctl reconfigure
最好重启一下电脑,发现在管理页面的url还是原来未更改的url
6.在浏览器里打开gitlab管理页面,如下图:
http://localhost
注意:第一次登录会让你重置登录密码。用户名为root
7.进入登录页面
8.新增group
步骤:点击左侧group-》new Group-》填内容,选externel-》save
9.新增project
9.新增project
步骤:点击新建的group-》new project-》save
10.授权
步骤:选中新建的project-》配置-》members-》add user
11.用受权的用户登录就可以看到这个项目了。