centos 下 gitlab 安裝

添加國內(nèi)gitlab源

vim /etc/yum.repos.d/gitlab-ce.repo

[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key

install

sudo yum install curl openssh-server openssh-clients postfix cronie
# 啟動(dòng) postfix 郵件服務(wù)
sudo service postfix start
# 啟動(dòng)失敗的話
vim /etc/postfix/main.cf
inet_interfaces = all

# 檢查 postfix
sudo chkconfig postfix on
# 安裝 GitLab 社區(qū)版
sudo yum install gitlab-ce
# 初始化 GitLab

關(guān)閉自帶nginx

vim /etc/gitlab/gitlab.rb
nginx['enable'] = false

nginx conf

# gitlab socket 文件地址
upstream gitlab {
  # 7.x 版本在此位置
  # server unix:/var/opt/gitlab/gitlab-rails/tmp/sockets/gitlab.socket;
  # 8.0 位置
  server unix://var/opt/gitlab/gitlab-rails/sockets/gitlab.socket;
}

server {
  listen *:80;

  server_name gitlab.liaohuqiu.com;   # 請修改為你的域名

  server_tokens off;     # don't show the version number, a security best practice
  root /opt/gitlab/embedded/service/gitlab-rails/public;

  # Increase this if you want to upload large attachments
  # Or if you want to accept large git objects over http
  client_max_body_size 250m;

  # individual nginx logs for this gitlab vhost
  access_log  /var/log/gitlab/nginx/gitlab_access.log;
  error_log   /var/log/gitlab/nginx/gitlab_error.log;

  location / {
    # serve static files from defined root folder;.
    # @gitlab is a named location for the upstream fallback, see below
    try_files $uri $uri/index.html $uri.html @gitlab;
  }

  # if a file, which is not found in the root folder is requested,
  # then the proxy pass the request to the upsteam (gitlab unicorn)
  location @gitlab {
    # If you use https make sure you disable gzip compression 
    # to be safe against BREACH attack

    proxy_read_timeout 300; # Some requests take more than 30 seconds.
    proxy_connect_timeout 300; # Some requests take more than 30 seconds.
    proxy_redirect     off;

    proxy_set_header   X-Forwarded-Proto $scheme;
    proxy_set_header   Host              $http_host;
    proxy_set_header   X-Real-IP         $remote_addr;
    proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;
    proxy_set_header   X-Frame-Options   SAMEORIGIN;

    proxy_pass http://gitlab;
  }

  # Enable gzip compression as per rails guide: http://guides.rubyonrails.org/asset_pipeline.html#gzip-compression
  # WARNING: If you are using relative urls do remove the block below
  # See config/application.rb under "Relative url support" for the list of
  # other files that need to be changed for relative url support
  location ~ ^/(assets)/  {
    root /opt/gitlab/embedded/service/gitlab-rails/public;
    # gzip_static on; # to serve pre-gzipped version
    expires max;
    add_header Cache-Control public;
  }

  error_page 502 /502.html;
}

配置

sudo gitlab-ctl reconfigure

502報(bào)錯(cuò)解決

sudo chmod -R o+x /var/opt/gitlab/gitlab-rails

漢化

#查看版本
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
#根據(jù)版本   diff對應(yīng)branch語言包
git clone https://gitlab.com/xhang/gitlab.git
sudo git diff origin/8-16-stable..8-16-stable-zh > /tmp/8.16.diff
cd /opt/gitlab/embedded/service/gitlab-rails
git apply /tmp/8.16.diff

啟動(dòng)

sudo gitlab-ctl start
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市积糯,隨后出現(xiàn)的幾起案子掂墓,更是在濱河造成了極大的恐慌,老刑警劉巖看成,帶你破解...
    沈念sama閱讀 217,542評論 6 504
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件君编,死亡現(xiàn)場離奇詭異,居然都是意外死亡川慌,警方通過查閱死者的電腦和手機(jī)吃嘿,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,822評論 3 394
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來窘游,“玉大人唠椭,你說我怎么就攤上這事∪淌危” “怎么了贪嫂?”我有些...
    開封第一講書人閱讀 163,912評論 0 354
  • 文/不壞的土叔 我叫張陵,是天一觀的道長艾蓝。 經(jīng)常有香客問我力崇,道長,這世上最難降的妖魔是什么赢织? 我笑而不...
    開封第一講書人閱讀 58,449評論 1 293
  • 正文 為了忘掉前任亮靴,我火速辦了婚禮,結(jié)果婚禮上于置,老公的妹妹穿的比我還像新娘茧吊。我一直安慰自己,他們只是感情好八毯,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,500評論 6 392
  • 文/花漫 我一把揭開白布搓侄。 她就那樣靜靜地躺著,像睡著了一般话速。 火紅的嫁衣襯著肌膚如雪讶踪。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,370評論 1 302
  • 那天泊交,我揣著相機(jī)與錄音乳讥,去河邊找鬼柱查。 笑死,一個(gè)胖子當(dāng)著我的面吹牛云石,可吹牛的內(nèi)容都是我干的唉工。 我是一名探鬼主播,決...
    沈念sama閱讀 40,193評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼汹忠,長吁一口氣:“原來是場噩夢啊……” “哼酵紫!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起错维,我...
    開封第一講書人閱讀 39,074評論 0 276
  • 序言:老撾萬榮一對情侶失蹤奖地,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后赋焕,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體参歹,經(jīng)...
    沈念sama閱讀 45,505評論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,722評論 3 335
  • 正文 我和宋清朗相戀三年隆判,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了犬庇。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 39,841評論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡侨嘀,死狀恐怖臭挽,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情咬腕,我是刑警寧澤欢峰,帶...
    沈念sama閱讀 35,569評論 5 345
  • 正文 年R本政府宣布,位于F島的核電站涨共,受9級特大地震影響纽帖,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜举反,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,168評論 3 328
  • 文/蒙蒙 一懊直、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧火鼻,春花似錦室囊、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,783評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至蛾默,卻和暖如春懦铺,著一層夾襖步出監(jiān)牢的瞬間捉貌,已是汗流浹背支鸡。 一陣腳步聲響...
    開封第一講書人閱讀 32,918評論 1 269
  • 我被黑心中介騙來泰國打工冬念, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人牧挣。 一個(gè)月前我還...
    沈念sama閱讀 47,962評論 2 370
  • 正文 我出身青樓急前,卻偏偏與公主長得像,于是被迫代替她去往敵國和親瀑构。 傳聞我的和親對象是個(gè)殘疾皇子裆针,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,781評論 2 354

推薦閱讀更多精彩內(nèi)容