良许Linux教程网 干货合集 Linux搭建GitLab具体步骤

Linux搭建GitLab具体步骤

Linux如何搭建gitlab?GitLab 是 Ruby 开发的自托管的 Git 项目仓库,可通过Web界面进行访问公开的或者私人项目,下面为大家分享一下Linux搭建GitLab具体步骤。

Linux搭建GitLab具体步骤

Linux搭建gitlab具体步骤

以root 身份进行登录linux

1.先安装相关依赖:

 sudo yum install -y curl policycoreutils-python openssh-server
 
 2.开启SSH
 开机自启动
 sudo systemctl enable sshd
 
 sudo systemctl start sshd3.防火墙永久开放http
 sudo firewall-cmd --permanent --add-service=http
 
 sudo systemctl reload firewalld(注释防火墙停止重启:systemctl start/stop/reload firewalld)
 4.

安装postfix,设置postfix开机自启,并启动,postfix支持gitlab发信功能

   yum install postfix

 systemctl enable postfix

 systemctl start postfix

下载gitlab:

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

安装(linux内存至少2g官方建议4g内存你配置linux内存的时候): mkdir /usr/local/gitlab

rpm -ivh gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

img

修改gitlab配置文件的服务器地址和端口,配置项:external_url,注意端口占用问题以及防火墙开通端口8989:

vi  /etc/gitlab/gitlab.rb

## GitLab URL ##! URL on which GitLab will be reachable. ##! For more details on configuring external_url see: ##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab external_url ‘http://192.168.81.129:8989

永久开放端口8989:

firewall-cmd –permanent –add-port=8989/tcp

重启防火墙,运行命令: firewall-cmd –reload

查看端口号是否开启,运行命令: firewall-cmd –query-port=8989/tcp

重新启动gitlab配置文件

gitlab-ctl reconfigure gitlab-ctl restart

以上两个完成现实分别如下:

Running handlers: Running handlers complete Chef Client finished, 362/515 resources updated in 04 minutes 18 seconds gitlab Reconfigured!

[root@hostuser gitlab]# gitlab-ctl restart ok: run: gitaly: (pid 26240) 1s ok: run: gitlab-monitor: (pid 26261) 0s ok: run: gitlab-workhorse: (pid 26264) 1s ok: run: logrotate: (pid 26314) 0s ok: run: nginx: (pid 26322) 1s ok: run: node-exporter: (pid 26334) 0s ok: run: postgres-exporter: (pid 26341) 0s ok: run: postgresql: (pid 26350) 0s ok: run: prometheus: (pid 26359) 0s ok: run: redis: (pid 26375) 1s ok: run: redis-exporter: (pid 26379) 0s ok: run: sidekiq: (pid 26387) 0s ok: run: unicorn: (pid 26397) 0s

进入页面地址栏点击你设置的ip:8989

密码至少8位 adminadmin建议

默认用户名root ,输入密码adminadmin

img

以上就是良许教程网为各位朋友分享的Linux系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你!

137e00002230ad9f26e78-265x300

本文由 良许Linux教程网 发布,可自由转载、引用,但需署名作者且注明文章出处。如转载至微信公众号,请在文末添加作者公众号二维码。
良许

作者: 良许

良许,世界500强企业Linux开发工程师,公众号【良许Linux】的作者,全网拥有超30W粉丝。个人标签:创业者,CSDN学院讲师,副业达人,流量玩家,摄影爱好者。
上一篇
下一篇

发表评论

联系我们

联系我们

公众号:良许Linux

在线咨询: QQ交谈

邮箱: yychuyu@163.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部