参考 http://blog.csdn.net/discoverer100/article/details/51814171
参考 https://about.gitlab.com/installation/#ubuntu
编者按:
docker大行其道,可以通过docker 安装gitlab,具体可以参考
https://www.jianshu.com/p/d707f70c60d2
https://www.cnblogs.com/int32bit/p/5310382.html
ubuntu 安装gitlab
0、 安装准备,主要是机器硬件要求
参考:https://www.cnblogs.com/gnool/p/6128546.html
1、安装依赖
sudo apt-get install -y curl openssh-server ca-certificates postfix
ca-certificates 维护SSL证书
postfix 电子邮件服务器
2、添加gitlab包仓库
curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null
3、添加gitlab实例的安装位置。
sudo apt-get update
sudo apt-get install gitlab-ce
4、配置启动
sudo gitlab-ctl reconfigure
5、其他服务启动
service sshd start
service postfix start
6、检查gitlab状态
sudo gitlab-ctl status
7、初始化登录
http://ip:80端口
8、修改默认的端口信息
01、修改默认的gitlab nginx的web服务80端
vim /var/opt/gitlab/nginx/conf/gitlab-http.conf
#listen *:80;
listen *:9999;
02、修改/etc/gitlab/gitlab.rb
vim /etc/gitlab/gitlab.rb
#unicorn['port'] = 8080 修改 8079 默认是注释的去掉前面的#
unicorn['port'] = 8079
#nginx['listen_port'] = nil 修改 9999 默认是注释的去掉前面的#
nginx['listen_port'] = 9999
external_url 'http://192.168.10.xxx'
03、修改/var/opt/gitlab/gitlab-rails/etc/unicorn.rb
vim /var/opt/gitlab/gitlab-rails/etc/unicorn.rb
#listen "127.0.0.1:8080", :tcp_nopush => true
listen "127.0.0.1:8079", :tcp_nopush => true
重启:
gitlab-ctl restart
问题:
出现ruby_block[supervise_redis_sleep] action run
参考:http://blog.csdn.net/u010837612/article/details/78909545
502错误:
参考:http://blog.csdn.net/wangxicoding/article/details/43738137
域名 gitlab.example修改成ip地址
修改 etc/gitlab/gitlab.rb 文件的时候记得就该如下的配置
external_url ‘http://192.168.10.xxx’
xxx为局域网地址
修改如下文件
vim /var/opt/gitlab/gitlab-rails/etc/gitlab.yml
host: 192.168.10.110
port: 9999
https: false
......
email_from: [email protected]
email_display_name:
注意:如上的方式默认已经安装好了gitlab-shell,
若是出现gitlab无法提交的问题,需要修改如下的gitlab-shell的配置文件
/opt/gitlab/embedded/service/gitlab-shell/config.yml
user: git
# Url to gitlab instance. Used for api calls. Should end with a slash.
gitlab_url: "http://192.168.10.xxx:9999"
配置邮件发送:
https://segmentfault.com/a/1190000011266124
丢失格式:参考
http://blog.csdn.net/huangjinlong77/article/details/30510705
另外一套基于ubuntu分发包的安装方式:
参考:http://blog.csdn.net/zy416548283/article/details/38057925
卸载:
sudo gitlab-ctl stop
sudo gitlab-ctl uninstall
sudo gitlab-ctl cleanse
sudo rm -rf /opt/gitlab
之后通过reboot命令重启系统即可