在 linux 下搭建 git & gitlab, 傻瓜式安装步骤,没有出错
- 下载 git 环境
yum install -y git
- 创建 git 用户, 管理 git 用户
useradd git
passwd git
- 安装 ssh
sudo yum install -y curl policycoreutils-pythonopenssh-server
- 将SSH服务设置成开机自启动
sudo systemctl enable sshd
- 启动SSH服务
sudo systemctl start sshd
- 安装防火墙 (可以忽略)
yum install firewalld systemd -y
- 开启防火墙,安装命令
service firewalld start
- 添加http服务到firewalld,pemmanent表示永久生效,若不加–permanent系统下次启动后就会失效
sudo firewall-cmd --permanent --add-service=http
- 重启防火墙
sudo systemctl reload firewalld
- 安装Postfix以发送通知邮件
sudo yum install postfix
- 将postfix服务设置成开机自启动
sudo systemctl enable postfix
- 启动postfix
sudo systemctl start postfix
- 进行下载 gitlab
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.3.3-ce.0.el7.x86_64.rpm
- 进行解压
rpm -i gitlab-ce-11.3.3-ce.0.el7.x86_64.rpm
解压过程可能会出现
rpm -i gitlab-ce-11.0.3-ce.0.el7.x86_64.rpm
如下报错:
警告:gitlab-ce-11.0.3-ce.0.el7.x86_64.rpm:
头V4 RSA/SHA1 Signature, 密钥 ID f27eab47: NOKEY
错误:依赖检测失败:
policycoreutils-python 被
gitlab-ce-11.0.3-ce.0.el7.x86_64 需要
[root@izbp191siji73ir3cjd0faz tools]# yum install
policycoreutils-python
执行: yum install policycoreutils-python
再次安装: rpm -i gitlab-ce-11.0.3-ce.0.el7.x86_64.rpm
15. 修改gitlab配置文件指定服务器ip和自定义端口
vim /etc/gitlab/gitlab.rb // http:// "ip地址":"端口号"
稍后在浏览器访问这个就可以
- 重置并启动 gitlab
gitlab-ctl reconfigure // 这个过程比较慢
gitlab-ctl restart