一、安装前置环境
1.安装一台虚拟机(步骤略),已有虚拟机故选择克隆。
选择一个虚拟机右键管理--克隆--下一页--创建完整克隆---修改虚拟机名称位置---下一步完成
2.进入虚拟机操作
(1)登录账户密码,修改机器名 hostnamectl set-hostname 机器名 #设置机器名 hostname #查看当前机器名 (2)安装vim(编辑器) wget(下载器)------如果已安装,可忽略 yum install -y vim wget (3)修改静态网络地址 vim /etc/sysconfig/network-scripts/ifcfg-ens33 #进入之后,按i编辑修改相应位置,并粘贴网络相关代码(左上角 编辑 粘贴) BOOTPROTO="dhcp" ====> BOOTPROTO="static" IPADDR="192.168.231.210" NETMASK="255.255.255.0" GATEWAY="192.168.231.2" DNS1="114.114.114.114" DNS2="8.8.8.8" ESC :wq(保存退出) #重启网络 systemctl restart network #检测网络是否能够连接外网 ping www.baidu.com -c 3 (4)绑定机器名和静态地址 vim /etc/hosts --->进入编辑i,两行地址下加下面命令 192.168.231.210 机器名 ESC :wq保存退出 (5)关闭防火墙 systemctl stop firewalld systemctl disable firewalld
二、后置 安装Gitlab
首先把gitlab-ce-12.4.2-ce.0.el6.x86_64.rpm文件复制到/opt下 此文件存放在:E:\gitlab (1) 安装ssh yum install -y curl policycoreutils-python openssh-server systemctl enable sshd #开机启动 systemctl start sshd #启动 (2) 安装postfix发送邮件 yum install postfix -y systemctl enable postfix systemctl start postfix (3) 按照地址用迅雷下载软件并安装 https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0- ce.0.el7.x86_64.rpm rpm -i gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm (4) 修改配置信息 vi /etc/gitlab/gitlab.rb external_url 'http://192.168.231.210:82' (esc+/ 可搜索单词,替换相应的地址,http://你的IP地址:端口) (5) 重启服务 gitlab-ctl reconfigure gitlab-ctl restart