Ubuntu下部署GitLab-——基于14.04系统
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu下部署GitLab-——基于14.04系统相关的知识,希望对你有一定的参考价值。
搭建GitLab的目的:
方便公司开发管理代码
GitLab实现的功能:
1、关闭了gitlab的注册功能
2、修改了默认端口
3、汉化
0、前期准备
# 环境 Ubuntu 14.04 [email protected]:~# apt-get install openssh-server [email protected]:~# apt-get install openssh-client [email protected]:~# apt-get install git
1、安装
[email protected]:~# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu/pool/trusty/main/g/gitlab-ce/gitlab-ce_8.8.0-ce.0_amd64.deb [email protected]:~# dpkg -i gitlab-ce_8.8.0-ce.0_amd64.deb
2、修改配置文件
[email protected]:~# vim /etc/gitlab/gitlab.rb external_url ‘http://X.X.X.X:8088‘ ...... gitlab_rails[‘time_zone‘] = ‘Asia/Shanghai‘ gitlab_rails[‘gitlab_email_from‘] = ‘[email protected]‘ ...... gitlab_rails[‘smtp_enable‘] = true gitlab_rails[‘smtp_address‘] = "smtp.163.com" gitlab_rails[‘smtp_port‘] = 25 gitlab_rails[‘smtp_user_name‘] = "[email protected]" gitlab_rails[‘smtp_password‘] = "111111" # 客户端授权密码 gitlab_rails[‘smtp_domain‘] = "163.com" gitlab_rails[‘smtp_authentication‘] = "login" gitlab_rails[‘smtp_enable_starttls_auto‘] = true ...... user["git_user_email"] = "[email protected]" ..... unicorn[‘listen‘] = ‘127.0.0.1‘ unicorn[‘port‘] = 8080 #配置文件默认为8080,若其他程序使用了8080端口,需要修为其他端口,否则网页报错502 # 只要修改配置文件就要reconfigure [email protected]:~# gitlab-ctl reconfigure
[email protected]:~# gitlab-ctl status run: gitlab-workhorse: (pid 8160) 17578s; run: log: (pid 7476) 17625s run: logrotate: (pid 3777) 3220s; run: log: (pid 7521) 17621s run: nginx: (pid 24024) 11294s; run: log: (pid 7487) 17623s run: postgresql: (pid 7218) 17650s; run: log: (pid 7217) 17650s run: redis: (pid 7084) 17656s; run: log: (pid 7083) 17656s run: sidekiq: (pid 22511) 11383s; run: log: (pid 7464) 17627s run: unicorn: (pid 13402) 10110s; run: log: (pid 7424) 17633s
[email protected]:~# netstat -anlt | grep 808 tcp 0 0 0.0.0.0:8088 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:8089 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
#其中8089是unicore端口,因主机8080端口已被其他程序使用
3、访问web页面
- 有时出现502,可以刷新网页或者再次reconfigure
- 有时需要sudo gitlab-ctl restart nginx
- 初次访问Web页面会强制让你改密码,初始用户名/密码:root/5iveL!fe
- 禁止前台注册
登录后:右上角 Admin Area --> Settings --> Sign-in Restrictions
然后保存
- 修改admin的邮箱
Admin Area --> Users --> Edit 然后保存
4、汉化
# 首先检查版本 [email protected]:~# cat /opt/gitlab/embedded/service/gitlab-rails/VERSION 8.8.0 [email protected]:~# git clone https://gitlab.com/larryli/gitlab.git [email protected]:~# cd gitlab/ # 比较8-8-stable(英文)和8-8-zh(汉化后)的区别然后导出为补丁 [email protected]:~# git diff origin/8-8-stable origin/8-8-zh > /tmp/8.8.diff # 应用补丁 [email protected]:~# sudo patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < /tmp/8.8.diff
转载出处:http://www.jianshu.com/p/49f60698b411
以上是关于Ubuntu下部署GitLab-——基于14.04系统的主要内容,如果未能解决你的问题,请参考以下文章
如何在ubuntu server 14.04下安装gitlab中文版
ubuntu14.04下安装ngnix,mediawiki,nodebb,everything,gitlab