linux 搭建 gitlab 私人服务器
要求:運行內存要在 2G 以上
整理步驟:
(1、安裝和配置必要的依賴 )
yum install -y curl openssh-server openssh-clients cronie
(2、將在系統防火墻打開HTTP和SSH訪問)
lokkit -s http -s ssh
(3、安裝postfix發送通知郵件)
yum install postfix
service postfix start
chkconfig postfix on
在安裝配置的屏幕可能會出現后綴。選擇“Internet站點”并按Enter鍵。使用服務器的外部DNS“郵件名稱”并按Enter鍵。如果出現額外的屏幕,繼續按回車鍵接受默認值。
(4、添加gitlab包庫安裝包)
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
【速度慢的話,換成下面的試試】
curl -sS http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh | sudo bash
(5、下載安裝包)
yum install -y gitlab-ce
(6、修改訪問方式)
vim /etc/gitlab/gitlab.rb
修改為:external_url ‘http://127.0.0.1:8081’
下面兩行注釋去掉并修改為:
unicorn[‘listen’] = ‘127.0.0.1’
unicorn[‘port’] = 8081
grep ^external_url /etc/gitlab/gitlab.rb
返回:
external_url ‘http://127.0.0.1:8081’ #正確
grep ^unicorn /etc/gitlab/gitlab.rb
返回:
unicorn[‘listen’] = ‘127.0.0.1’ #正確
unicorn[‘port’] = 8081
(7、配置并啟動gitlab)
gitlab-ctl reconfigure
【注意】
日志位置:/var/log/gitlab 可以進去查看訪問日志以及報錯日志等,供訪問查看以及異常排查。
gitlab-ctl tail nginx/gitlab_access.log #查看nginx訪問日志
gitlab-ctl tail #查看所有日志
gitlab-ctl start|stop|status|restart #日常操作
每次重新配置,也可以 gitlab-ctl reconfigure 使之生效
【卸載】
gitlab-ctl help來獲取相關命令
gitlab-ctl uninstall,(此方法在 /opt/gitlab 下,沒有就是不存在)關于其的說明是
Kill all processes and uninstall the process supervisor (data will be preserved).
但在實際操作中,只通過uninstall無法徹底卸載gitlab
以下方法可徹底卸載:
gitlab-ctl stop
gitlab-ctl uninstall
gitlab-ctl cleanse
rm -rf /opt/gitlab
參考網址:
https://about.gitlab.com/installation/#centos-6
blog.csdn.net/michaelzhouh/article/details/48374431
http://blog.csdn.net/m0_37886429/article/details/73603481
【大神文檔】
http://blog.csdn.net/ouyang_peng/article/details/72903221
【中文社區(漢化)】
https://gitlab.com/xhang/gitlab
總結
以上是生活随笔為你收集整理的linux 搭建 gitlab 私人服务器的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 酷狗繁星新人如何把握第一个月?酷狗繁星新
- 下一篇: Golang基础链表