AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 686566
Accepted
ubiquibacon
ubiquibacon
Asked: 2015-04-30 11:44:21 +0800 CST2015-04-30 11:44:21 +0800 CST 2015-04-30 11:44:21 +0800 CST

无法使用 Apache 和 Tomcat 在端口 80 上运行 GitLab

  • 772

我使用 Omnibus 安装程序安装了 GitLab。它目前使用在端口 81 上运行的 Nginx(与 GitLab 捆绑在一起)正常工作。我从端口 80 更改为端口 81,因为我在端口 80 上运行了 Apache。我还在端口 8080 上安装并运行了 Tomcat,所以我改变了独角兽端口到 8081。所有这些都正常工作。以下是我更改的设置:

/etc/gitlab/gitlab.rb

# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/629def0a7a26e7c2326566f0758d4a27857b52a3/README.md#configuring-the-external-url-for-gitlab
external_url 'http://mysite.example.net:81'

#https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#tcp-ports-for-gitlab-services-are-already-taken
unicorn['port'] = 8081

#https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#storing-git-data-in-an-alternative-directory
git_data_dir "/mnt/tank/gitlab"

/var/opt/gitlab/gitlab-rails/etc/gitlab.yml

production: &base
  #
  # 1. GitLab app settings
  # ==========================

  ## GitLab settings
  gitlab:
    ## Web server settings (note: host is the FQDN, do not include http://)
    host: mysite.example.net
    port: 81
    https: false

不幸的是,我需要 GitLab 在端口 80 上运行。我尝试了几种 Apache 虚拟主机配置。我唯一的成功是我可以键入 URLhttp://mysite.example.com/gitlab并收到 404 错误,但我看到 URL 更改为http://mysite.example.com/users/sign_in. 重定向导致将gitlab其删除,但如果我将其放回以获取 URL,http://mysite.example.com/gitlab/users/sign_in我可以看到 GitLab 登录页面,尽管它全部被顶起,因为没有图像是正确的。我用来实现这些结果的配置如下:

/etc/gitlab/gitlab.rb

    # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/629def0a7a26e7c2326566f0758d4a27857b52a3/README.md#configuring-the-external-url-for-gitlab
    external_url 'http://mysite.example.com'

#https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#tcp-ports-for-gitlab-services-are-already-taken
    unicorn['port'] = 8081

    #https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#storing-git-data-in-an-alternative-directory
    git_data_dir "/mnt/tank/gitlab"

    #https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/nginx.md#using-a-non-bundled-web-server
    nginx['enable'] = false
    web_server['external_users'] = ['www-data']

/etc/apache2/apache2.conf

ServerName mysite.example.com

ProxyRequests Off
<Proxy *>
        Order Allow,Deny
        Allow from all
</Proxy>

# transmission
ProxyPass /transmission http://localhost:9091/transmission
ProxyPassReverse /transmission http://localhost:9091/transmission

# gitlab
ProxyPass /gitlab http://localhost:8081
ProxyPassReverse /gitlab http://localhost:8081

/var/opt/gitlab/gitlab-rails/etc/gitlab.yml

production: &base
  #
  # 1. GitLab app settings
  # ==========================

  ## GitLab settings
  gitlab:
    ## Web server settings (note: host is the FQDN, do not include http://)
    host: mysite.example.com
    port: 80
    https: false
apache-2.4
  • 1 1 个回答
  • 3990 Views

1 个回答

  • Voted
  1. Best Answer
    zomnombom
    2017-07-05T03:39:07+08:002017-07-05T03:39:07+08:00

    我有一个类似的问题,想用 apache 设置 gitlab,但我不知道我的解决方案是否适用于你的情况:

    我将子域“gitlab.example.com”的 dns 记录设置为指向域“example.com”,并为子域添加了一个虚拟主机。这使我可以使用“/”而不是“/gitlab”的代理工作。这是我的配置文件:

    /etc/gitlab/gitlab.rb:

    external_url 'http://localhost:81'
    

    虚拟主机(在 /etc/apache2/apache2.conf 中)

    <VirtualHost *:80>
        ServerName gitlab.example.com
    
        ProxyPass /  http://localhost:81
        ProxyPassReverse / http://localhost:81
    </VirtualHost>
    

    这样我可以通过' http://gitlab.example.com '使用gitlab

    • 1

相关问题

  • SELinux 阻止 Apache 写入文件

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve