gpt4 book ai didi

git - 在运行 Parallels Plesk 的 VPS 上安装 GitLab

转载 作者:太空狗 更新时间:2023-10-29 14:07:36 30 4
gpt4 key购买 nike

我正在考虑在我的 VPS 上安装 GitLab Community Edition,它目前也在运行 svn 和 Parallels Plesk(git 最终应该取代 svn)。 VPS 托管几个网站,其中没有一个负载很重。

VPS 规范:中央操作系统 6.5内存 2GbCPU 英特尔至强 2,3Ghz

我想知道 the installation GitLab 的一部分可能会以某种方式搞砸 Plesk,或者两者会完美地协同工作?

另外:如何将域名绑定(bind)到服务器上?即 git.myserver.com不应该通过 plesk 完成,对吗?

最佳答案

  1. 在 Plesk 中添加一个新的子域,例如gitlab.domain.com.
  2. 删除以下所有文件:/var/www/vhosts/domain.com/gitlab.domain.com/
  3. /etc/nginx/conf.d/中添加一个新文件gitlab.conf,内容如下:
    upstream gitlab {    # for manual installation    server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;    # for omnibus installation    server unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket;}
  4. in Plesk select Websites & Domains > your subdomain > Webserver Settings - remove all ticks under "nginx settings" and add the following code to "Additional nginx directives"

    location ~ / {    # serve static files from defined root folder;.    # @gitlab is a named location for the upstream fallback, see below    # for manual installation    root /home/git/gitlab/public;    # for omnibus installation    root /opt/gitlab/embedded/service/gitlab-rails/public;    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 {    proxy_read_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694    proxy_connect_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694    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_pass http://gitlab;
    }
  5. 保存此设置并重新启动您的服务器

注意:也许您必须更改一些权限 - 另请参阅 https://github.com/gitlabhq/gitlabhq/issues/2071

关于git - 在运行 Parallels Plesk 的 VPS 上安装 GitLab,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24684434/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com