开门见山
Gitlab拥有与github相似的功能。在本地服务器搭建gitlab后,可以将代码托管到服务器的仓库上。通过使用git小乌龟,
就可以实现代码的克隆和拉取。通过为不同人员分配账号密码,就可以让项目组成员合作开发新项目。
准备工作:安装VMware Workstation Pro虚拟机。下载镜像文件centos6或者centos7,6,和7的命令是不一样的,
建议下载centos7.比较新。然后安装。虚拟机的内存必须保证至少4G,低于2G无法安装gitlab。
一、安装gitlab
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. 安装gitlab安装包
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce
3.相关配置。即在external_url填上自己服务器的ip
vim /etc/gitlab/gitlab.rb
4.配置端口号和server_name
cd /var/opt/gitlab/nginx/conf
vim gitlab-http.conf
5.重启服务以便应用以上配置
sudo gitlab-ctl reconfigure
6.临时关闭防火墙
systemctl stop firewalld
7.禁止开机启动
systemctl disable firewalld
8.测试访问
在浏览器输入服务器的ip加端口即可访问。如172.169.1.211:1100。
默认的账号和密码为:root和5iveL!fe。
至此,gitlab安装成功。后面我们将介绍如何用gitlab创建项目,分配用户组。
以及如何使用乌龟克隆项目,提交项目。
谢谢观看,如有不足,敬请指教