GitLab服务器IP地址设置

最近使用GitLab 搭建了Git的私有仓库,但是发现私有仓库的地址居然是localhost,不是本机的IP地址,最后百度了一下,找了很久才找到,特此记录一下.

首先说明一下,我Linux虚拟机的IP地址是192.168.142.134. 

 

1、在GitLab上新建一个项目test_gitlab,刚开始仓库地址是http://localhost/yulei/test_gitlab.git .

把localhost 换成本机的IP地址,修改方式如下:

修改gitlab.yml文件:

 

[python] view plain copy
 
  1. [root@localhost config]# cd /opt/gitlab/embedded/service/gitlab-rails/config  

 

2、修改gitlab.yml文件

 

[python] view plain copy
 
  1. [root@localhost config]# vim gitlab.yml  

修改gitlab下host值为实际的域名或服务器IP地址即可,保存退出

3、重启GitLab

 

 

[python] view plain copy
 
  1. gitlab-ctl restart  


最后刷新浏览器,地址地址变成http://192.168.142.134/yulei/test_gitlab.git

posted @ 2017-09-01 20:05  牧之丨  阅读(4941)  评论(0编辑  收藏  举报