limux CentOS release 6.5 安装gitlab
需要的安装包是:gitlab-ce-8.9.9-ce.0.el6.x86_64.rpm
要找到对应的安装包,否则安装会遇到各种各样的问题,用工具上传安装包到服务器
安装
rpm -ivh gitlab-ce-8.9.9-ce.0.el6.x86_64.rpm
修改gitlab配置文件指定服务器ip和自定义端口
vim /etc/gitlab/gitlab.rb
执行下列命令启动
gitlab-ctl reconfigure
gitlab-ctl start
重起:
gitlab-ctl reconfigure
gitlab-ctl restart
在安装gitlab,新建项目之后,默认的clone链接为[email protected]:test/test.git,http也是gitlab.example这种的
这样每次clone时候都需要手动改下,改成ip或者域名才可以,可以按照如下方式更改external_url,也就是gitlab.example e
直接更改/etc/gitlab/gitlab.rb不能生效,更改/opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml文件(centos7)中
host和port即可
host可以换成域名,port更改为gitlab服务的端口,这里不设置的话在clone http url时候还是不行,需要把端口加上
修改配置文件:
vi /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
# 1. GitLab app settings
# ==========================
## GitLab settings
gitlab:
## Web server settings (note: host is the FQDN, do not include http://)
host: 10.119.116.160
port: 8181
https: false
访问刚才设置的地址http://ip:端口,如下图,如果访问不到,请查看你的防火墙是否打开,如果打开请关闭,或者将端口增加到防火墙中,刚开始访问到也没需要你修改密码,默认用户为root
如果是阿里云的服务器,得打开安全组,设置端口可访问
查看gitlab的版本:
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
参考资料:
https://blog.****.net/sunjianbin008/article/details/84197998