当前位置: 首页 > Linux

gitlab服务器设置

时间:2023-04-06 22:48:07 Linux

1。GitLab基本介绍GitLab使用开源版本管理系统RubyonRails实现了一个自托管的Git项目仓库,可以通过Web界面访问公共或私有项目。与Github类似,GitLab能够浏览源代码、管理缺陷和评论。可以管理团队对存储库的访问,浏览提交的版本非常容易,并提供文件历史库。团队成员可以使用内置的简单聊天程序(Wall)进行交流。还提供了代码片段收集功能,可以轻松实现代码复用,方便以后需要的时候查找。Gitlab官网下载地址:https://packages.gitlab.com/g...2.GitLab工作流程3.Gitlab环境部署3.1Gitlab预装查看linux版本[root@Git~]#cat/etc/redhat-releaseCentOSLinuxrelease7.6.1810(Core)设置IP地址10.0.0.105[root@Git~]#vim/etc/sysconfig/network-scripts/ifcfg-ens33TYPE="Ethernet"PROXY_METHOD="none"BROWSER_ONLY="no"#BOOTPROTO="static"#BOOTPROTO="dhcp"DEFROUTE="yes"IPV4_FAILURE_FATAL="no"IPV6INIT="yes"IPV6_AUTOCONF="yes"IPV6_DEFROUTE="yes"IPV6_FAILURE_FATAL="no"IPV6_ADDR_GEN_MODE="stable-privacy"NAME="ens33"DEVICE="ens33"ONBOOT="yes"IPADDR=10.0.0.105NETMASK=255.255.255.0GATEWAY=10.0.0.2DNS1=10.0.0.2ZONE=public安装Gitlab需要的依赖包curlpolicycoreutils-pythonopenssh-serveropenssh-clientsyuminstall-ycurlpolicycoreutils-pythonopenssh-serveropenssh-clientsstartsshd[root@Git~]#systemctlenablesshd[root@Git~]#systemctlstartsshd防火墙永久打开http[root@Git~]#firewall-cmd--permanent--add-service=http#sameasfirewall-cmd--add-port=80/tcp--permanentsuccess[root@Git~]#systemctl重装firewalld3.2安装Gitlab-ce社区版(yum模式)[root@Git~]#curl-shttps://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh|bash[root@Git~]#yuminstall-ygitlab-ce.x86_64[root@Git~]#rpm-qagitlab-cegitlab-ce-12.1.1-ce.0.el7.x86_643.3更改Gitlab配置文件修改Gitlab配置文件(搜索unicorn修改端口)[root@Git~]#vim/etc/gitlab/gitlab.rb更改url地址(同上一个配置文件)更改Gitlib内置nginx配置文件vim/var/opt/gitlab/nginx/conf/gitlab-http.conf加载配置使gitlab配置生效[root@Git~]#gitlab-ctlreconfigurefirewallsettingspermanentlyopenport8050[root@Gitgitlab]#firewall-cmd--add-port=8050/tcp--permanentsuccess[root@Git~]#systemctlreloadfirewalld启用gitlab[root@Git~]#gitlab-ctlstartsetgitlabboot自启动服务[root@Gitgitlab]#systemctlenablegitlab-runsvdir[root@Git~]#systemctlstatusgitlab-runsvdirgitlab-runsvdir.service-GitLabRunit监督进程Loaded:loaded(/usr/lib/systemd/system/gitlab-runsvdir.service;enabled;vendor预设:禁用)活动:自2019年7月星期一起活动(运行)-2912:29:14CST;3小时36分钟前主要PID:8665(runsvdir)CGroup:/system.slice/gitlab-runsvdir.service4。访问GitLab页面,直接输入服务器ip和指定端口进行访问(如本机10.0.0.105:8050)设置密码登录界面账号:root密码:xxxxx