
我嘗試在小型個人伺服器上安裝 GitLab 並對其進行配置,以便它可以在 Plesk WebAdmin 子網域上運行。我通常透過 Omnibus 套件安裝 GitLab。我在 gitlab.rb 檔案中更改了以下設定:
nginx['enable'] = false
web_server['external_users'] = ['www-data', 'PLESK_USER']
web_server['group'] = 'psacln'
gitlab_workhorse['listen_network'] = "tcp"
gitlab_workhorse['listen_addr'] = "127.0.0.1:8181"
其中 PLESK_USER 是連結到該 plesk 子網域的使用者。
我在子網域上將 HTTP 重新導向到 HTTPS,這有效,SSL 憑證也有效。
在 Plesk 中的「HTTPS 附加指令」下,我將此頁面中的文字貼到標籤中<VirtualHost *:443>
。
https://gitlab.com/gitlab-org/gitlab-recipes/blob/master/web-server/apache/gitlab-omnibus-ssl-apache24.conf
我替換了 YOUR_SERVER_FQDN 以及 3 SSLCertificateFile 行(使用我在 /var/www/vhosts/system/fqdn/conf/last_nginx.conf 下找到的行)
訪問我的網域時,我立即收到 500 錯誤。這是在創建 root 使用者之前。該訊息似乎是 GitLab 特定的,具有 GitLab 徽標和相應的文本,因此我相信到 GitLab 本身的路由似乎正在工作。
在生產日誌中,我只獲得每次網站訪問的以下輸出:
Started GET "/-/metrics" for 127.0.0.1 at 2019-05-27 11:59:44 +0000
Processing by MetricsController#index as HTML
Completed 200 OK in 2ms (Views: 0.4ms | ActiveRecord: 0.0ms | Elasticsearch: 0.0ms)
並使用 gitlab-ctl tail
==> /var/log/gitlab/gitlab-rails/production.log <==
Started GET "/-/metrics" for 127.0.0.1 at 2019-05-27 12:01:29 +0000
Processing by MetricsController#index as HTML
Completed 200 OK in 2ms (Views: 0.4ms | ActiveRecord: 0.0ms | Elasticsearch: 0.0ms)
==> /var/log/gitlab/gitlab-rails/production_json.log <==
{"method":"GET","path":"/-/metrics","format":"html","controller":"MetricsController","action":"index","status":200,"duration":2.64,"view":0.41,"db":0.0,"time":"2019-05-27T12:01:29.670Z","params":[],"remote_ip":null,"user_id":null,"username":null,"ua":null,"queue_duration":null,"correlation_id":"98970bd1-9618-41ea-85a2-5f59b26fd16b"}
對於我發出的每個瀏覽器請求,這些訊息都會立即顯示一次。
sudo gitlab-rake gitlab:check --trace
也沒有透露任何進一步缺失的資訊。缺乏任何具體的錯誤訊息使我相信 Plesk 和 GitLab 之間的連結存在問題,而不是 GitLab 安裝本身存在問題,但我在其他地方找不到這個具體問題,而且我真的沒有想法檢查什麼。
我很感激任何幫助。
編輯:在應用程式啟動時(每次重新啟動後)檢查 /var/log/gitlab/gitlab-workhorse/current 中的日誌,我可以看到以下錯誤訊息
2019-05-27_13:11:49.39615 time="2019-05-27T13:11:49Z" level=error msg="unknown error" error="keywatcher: pubsub receive: EOF"
2019-05-27_13:11:49.39617 time="2019-05-27T13:11:49Z" level=info msg="redis: dialing" address=/var/opt/gitlab/redis/redis.socket network=unix
2019-05-27_13:11:49.39617 time="2019-05-27T13:11:49Z" level=error msg="unknown error" error="keywatcher: dial unix /var/opt/gitlab/redis/redis.socket: connect: no such file or directory"
然而,由於我沒有更改最初提到的設置之外的任何設置,因此我無法真正找到與我的特定配置的任何連接。
答案1
我現在已經解決了這個問題。
在我的 Plesk 介面中的「工具與設定」-「Apache Web 伺服器」下,未啟用模組「proxy_http」。透過上述配置啟用此模組完美解決問題!希望這可以幫助將來遇到相同問題的人。