簡體   English   中英

在具有Plesk和Apache2的運行Ubuntu 14.04的vServer上設置GitLab 8.16.0

[英]Setting up GitLab 8.16.0 on a vServer running Ubuntu 14.04 with Plesk and Apache2

我試圖在vServer上安裝GitLab,發現如果您根本不了解服務器管理/配置,這可能是一項艱巨的任務。

任務 :在虛擬主機上安裝GitLab 8.16.0 CE。 服務器在Ubuntu 14.04上運行通過Plesk的域管理和Web服務器應為apache2

即使有幾個人也有類似我的問題,有必要從幾個來源收集最終解決方案。

以下步驟似乎有效:

1.在Plesk中添加您的(子)域。

在此示例中,我選擇了子域git.myVServer.com

2.編輯apache配置

  • 進入配置目錄

     cd /etc/apache2/ 
  • Listen 81添加到ports.conf文件

  • 轉到您的虛擬主機的其他配置文件

     cd /var/www/vhosts/system/git.myVServer.com/conf/ 
  • 添加具有以下內容的vhost.conf
    (改自這個GitLab倉庫

     DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public ServerName http://git.myVServer.com ServerSignature Off ProxyPreserveHost On AllowEncodedSlashes NoDecode <Location \\> Require all granted #Allow forwarding to gitlab-workhorse ProxyPassReverse http://127.0.0.1:8081 ProxyPassReverse http://git.myVServer.com:81 </Location> RewriteEngine on #Forward all requests to gitlab-workhorse except existing files like error documents RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR] RewriteCond %{REQUEST_URI} ^/uploads/.* RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA,NE] # needed for downloading attachments DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public #Set up apache error documents, if back end goes down (ie 503 error) then a maintenance/deploy page is thrown up. ErrorDocument 404 /404.html ErrorDocument 422 /422.html ErrorDocument 500 /500.html ErrorDocument 502 /502.html ErrorDocument 503 /503.html # It is assumed that the log directory is in /var/log/httpd. # For Debian distributions you might want to change this to # /var/log/apache2. LogFormat "%{X-Forwarded-For}i %l %u %t \\"%r\\" %>s %b" common_forwarded ErrorLog /var/log/apache2/gitlab_error.log CustomLog /var/log/apache2/gitlab_forwarded.log common_forwarded CustomLog /var/log/apache2/gitlab_access.log combined env=!dontlog CustomLog /var/log/apache2/gitlab.log combined 
  • 應用您的虛擬主機的更改

     /opt/psa/admin/sbin/httpdmng --reconfigure-domain git.myVServer.com 
  • 重新啟動Apache

     /etc/init.d/apache2 restart 

3.安裝GitLab

  • 請遵循本頁上的GitLab-ce多功能安裝說明。

    1. sudo apt-get install curl openssh-server ca-certificates postfix

    2. curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

    3. sudo apt-get install gitlab-ce

  • 在運行GitLab重新配置之前,我們必須更改一些設置:
    cd /etc/gitlab/
    並確保未注釋掉以下設置並將其設置為:

     external_url 'http://git.myVServer.com' gitlab_url = 'http://127.0.0.1:8081' gitlab_workhorse['listen_network'] = "tcp" gitlab_workhorse['listen_addr'] = "127.0.0.1:8181" unicorn['port'] = 8081 nginx['enable'] = false web_server['external_users'] = ['www-data'] 
  • 應用更改:

     gitlab-ctl reconfigure 
  • 檢查一切是否正常:

     gitlab-ctl status 

4.完成。

現在,如果一切按計划進行,您的GitLab實例應該正在運行,您可以從http://git.myVServer.com


后記
由於我沒有足夠的知識來配置類似這樣的東西,因此,只要有可能得到糾正,我將很高興。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM