栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

gitlab 代码仓库搭建

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

gitlab 代码仓库搭建

安装基础RPM包

[root@hy-205 yum.repos.d]# yum install curl policycoreutils openssh-server openssh-clients postfix -y

 curl下载 gitlab脚本

[root@hy-205 ~]# curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
修改 yum源
vim/etc/yum.repos.d/gitlab_gitlab-ce.repo

[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key
install gitlab-ce
[root@hy-205 yum.repos.d]# yum install gitlab-ce -y
修改gitlab配置 端口号
vim /etc/gitlab/gitlab.rb

​
[root@hy-205 gitlab]# egrep -v '#|^$' /etc/gitlab/gitlab.rb
external_url 'http://10.100.214.205:8159'
nginx['listen_port'] = 8159
初始化
[root@hy-205 gitlab]# gitlab-ctl reconfigure
[root@hy-205 ~]# gitlab-ctl start 
[root@hy-205 ~]# netstat -tunlp |grep 8159             

tcp        0      0 0.0.0.0:8159            0.0.0.0:*               LISTEN      17432/nginx: master 
nginx.conf 配置反向代理
##nginx.conf 中设置 

upstream default_backend_gitlab {
    server 10.100.214.205:8159    max_fails=3 fail_timeout=10s;
}
server {
    server_name gitlab.hy.com;
    location / {
        proxy_pass http://default_backend_gitlab;
        proxy_set_header Host       $http_host;
        proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
    }
}

测试是否可以登录

修改原始密码
[root@hy-205 gitlab]# cat /etc/gitlab/initial_root_password 

# WARNING: This value is valid only in the following conditions

1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).
 2. Password hasn't been changed manually, either via UI or via command line.
 If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.

Password: eydA9C956JBk6Ioai3ISCw/mrfqiBYfG7rKI19PBW5o=

# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.
进行自定义设置
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/344509.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号