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.

进行自定义设置

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

石兴稳

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值