Centos7下搭建Gitlab服务器
1 简介
gitlab是一个基于git实现的在线代码仓库托管软件,一般用于在企业、学校等内部网络搭建专属git仓库,越来越多的企业在使用gitlab作为项目托管仓库。
GitLab是利用Ruby On Rails开发的一个开源版本管理系统,实现了一个自托管的Git项目仓库,是集代码托管,测试,部署于一体的开源git仓库管理软件,可通过web界面来进行访问公开的或私人项目。与Github类似,GitLab能够浏览代码,管理缺陷和注释。可以管理团队对仓库的访问,它非常易于浏览提交过的版本,并提供一个文件历史库。它还提供一个代码片段收集功能可以轻松实现代码复用,便于日后需要的时候查找。
Git的家族成员
名称 | 说明 |
---|---|
Git | 一种版本控制系统,是一个命令,是一种工具 |
Gitlib | 用于实现Git功能的开发库 |
Github | 一个基于Git实现的在线代码托管仓库,公开项目是免费的,也可以付费创建私人项目 |
GitLab | 一个基于Git实现的在线代码仓库托管软件,可以用GitLab搭建一套类似Github的系统 |
GitLab对硬件还是有一定要求的,1核心的CPU基本上可以满足需求,大概支撑100个左右的用户,不过在运行GitLab网站的同时还需要运行多个后台job,就会显得有点捉襟见肘了。需要至少4GB的可寻址内存(RAM交换)来安装和使用GitLab,操作系统和任何其他正在运行的应用程序也将使用内存,因此请记住,在运行GitLab之前,您至少需要4GB的可用空间,如果使用更少的内存,GitLab将在重新配置运行期间给出奇怪的错误。
2 安装配置依赖
2.1 安装启动ssh服务
[root@~]# sudo yum install -y curl policycoreutils-python openssh-server #安装ssh
[root@~]# sudo systemctl enable sshd #开机自启
[root@~]# sudo systemctl start sshd #启动ssh
[root@~]# sudo systemctl status sshd
2.2 配置防火墙
[root@~]# sudo firewall-cmd --state#查看防火墙状态
not running
[root@~]# sudo systemctl start firewalld #没有启动,可以启动防火墙
[root@~]# sudo firewall-cmd --permanent --add-service=http#添加防火墙支持http永久访问
[root@~]# sudo systemctl reload firewalld#重新加载防火墙配置
[root@~]# sudo systemctl status firewalld.service
2.3 安装邮件服务
[root@~]# sudo yum install postfix -y #安装postfix
[root@~]#sudo systemctl enable postfix #开机自启
[root@~]# sudo systemctl start postfix #启动postfix
出现错误:
Job for postfix.service failed because the control process exited with error code. See "systemctl status postfix.service" and "journalctl -xe" for details.
[root@~]# sudo systemctl status postfix
解决办法:
编辑/etc/postfix/main.cf文件,将inet_interfaces设置为all,再次启动postfix
[root@~]# vi /etc/post