ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

Git基础(20):自建代码托管平台GitLab(rpm)

Git基础(20):自建代码托管平台GitLab(rpm) 文章目录环境说明安装GitLabgitlab-ctl命令环境说明系统版本centos.7.9.2009安装GitLab安装相关依赖yum-yinstallpolicycoreutils openssh-clients postfix安装ssh服务并设置为开机启动systemctlenablesshdsudosystemctl start sshd# 查看服务状态systemctl status sshd设置postfix开机自启和并启动postfix支持gitlab发信功能systemctlenablepostfixsystemctl start postfix开放ssh以及http服务firewall-cmd --add-servicessh--permanentfirewall-cmd --add-servicehttp--permanent# 重新加载防火墙firewall-cmd--reload下载gitlab并进行安装清华下载源 https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/# 下载rpm安装包wgethttps://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.4.2-ce.0.el7.x86_64.rpm --no-check-certificate# 或者curl-Ohttps://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.4.2-ce.0.el7.x86_64.rpm# 安装rpm-ivhgitlab-ce-12.4.2-ce.0.el6.x86_64.rpm如果 rpm -ivh gitlab-ce-12.4.2-ce.0.el7.x86_64.rpm 安装错误请先执行 yum install policycoreutils-python然后再执行rpm安装命令6 修改gitlab配置vim/etc/gitlab/gitlab.rb修改访问地址和端口默认端口为80这里更改为88external_urlhttp://192.168.88.50:88nginx[listen_port]88重新加载配置并重启gitlabgitlab-ctl reconfigure gitlab-ctl restart8 将端口添加到防火墙firewall-cmd--zonepublic --add-port88/tcp--permanentfirewall-cmd--reload自此可以访问GitLab了http://192.168.88.50:88/第一次进去需要给root账号设置密码(不少于8位)。 完成密码更改即可登录GitLab。gitlab-ctl命令gitlab-ctl start#启动所有 gitlab 组件gitlab-ctl stop#停止所有 gitlab 组件gitlab-ctl restart#重启所有 gitlab 组件gitlab-ctl status#查看服务状态gitlab-ctl reconfigure#重启配置gitlab-ctltail#查看日志vim/etc/gitlab/gitlab.rb#修改gitlab的配置文件
返回列表