gitLab安装、配置、开机自启动

参考:参考官方网址:https://about.gitlab.com/downloads/#ubuntu1604 该文章适合有一定gitlab知识者使用,图片较少 ##1、安装依赖包,运行如下命令: sudo apt-get install curl openssh-server ca-certificates postfix #####注意:此处运行后系统弹出选择框,此处选择Internet那一项(不带Smarthost的),填写邮箱后下一步直接操作 ##1、安装依赖包,运行如下命令: curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash ##2、更新安装 gitlab-ce: sudo apt-get update sudo apt-get install gitlab-ce ##3、配置并启动: sudo gitlab-ctl reconfigure ##4、登录web页面,查看是否已安装,登录后会提示设置密码,用户名默认未root http://172.17.8.210/ ####登录可能导致502异常,原因是默认启动8080端口,已经被占用,修改配置文件中可以更改端口号 ##5、更改配置文件,我在系统中mount了一块硬盘(如何mount硬盘请参考我的其他博客),然后将这个git的工作空间指向了该硬盘地址。(由于云服务器只提供2G免费空间) vim /etc/gitlab/gitlab.rb ###这个配置文件中请大家注意几个关键地方 ###(1)访问地址external_url:此处可以配置成域名访问(http://xxx.domain.com),如果配置域名访问,需要在hosts文件文件中加入该域名IP映射(127.18.2.3 xxx.domain.com) ## GitLab URL ##! URL on which GitLab will be reachable. ##! For more details on configuring external_url see: ##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab external_url 'http://172.17.8.210' ###(2)工作空间git_data_dir:,此处指向扩展硬盘空间, ### For setting up different data storing directory ###! Docs: https://docs.gitlab.com/omnibus/settings/configuration.html#storing-git-data-in-an-alternative-directory ###! If you want to use a single non-default directory to store git data use a ###! path that doesn't contain symlinks. #git_data_dirs({"default" => "/var/opt/gitlab/git-data"}) git_data_dir "/optdata/gitlab/repositories" #####保存后执行 gitlab-ctl reconfigure 即可,此处执行启动后,登录可能导致502异常,原因是默认启动8080端口,已经被占用,下边方式更改端口号 ###(3)修改访问端口,将注释#号去掉,修改端口号 ### Advanced settings # unicorn['listen'] = '127.0.0.1' unicorn['port'] = 8090 # unicorn['socket'] = '/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket' # unicorn['pidfile'] = '/opt/gitlab/var/unicorn/unicorn.pid' # unicorn['tcp_nopush'] = true # unicorn['backlog_socket'] = 1024

更新配置并运行 sudo gitlab-ctl reconfigure

###(4)Nginx配置反向代理访问 Gitlab 这里转载其他人的博客 https://segmentfault.com/a/1190000007661272 ##6、gitlab启动后,可以创建group、user,project 输入图片说明 ##7、gitlab启动后,如下从其他git库上同步代码 https://root:111111@gitlab.domain.com/group/project.git 其中root:111111未同步源git地址用户名密码 输入图片说明

##8、开机自启动 参考我的博客ubuntu开机启动 https://my.oschina.net/u/3196846/blog/867233

转载于:https://my.oschina.net/jiahaov/blog/867232

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值