我使用Omnibus安装程序安装了GitLab。目前,它正在使用运行在端口81上的Nginx (与GitLab捆绑在一起)正确工作。我从端口80更改为端口81,因为我在端口80上运行Apache。我还在端口8080上安装和运行Tomcat,所以我将Unicorn端口更改为8081。所有这些都是正确的。下面是我更改的设置:
# 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"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虚拟主机配置。我唯一的成功是我可以输入http://mysite.example.com/gitlab并得到一个404错误,但是我看到这个URL更改为http://mysite.example.com/users/sign_in。重定向导致gitlab被删除,但如果我将其放回以获取http://mysite.example.com/gitlab/users/sign_in URL,我可以看到GitLab登录页面,尽管所有这些图像都没有正确。我用来实现这些结果的配置如下:
# 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']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:8081production: &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发布于 2017-07-04 11:39:07
我也遇到过类似的问题,希望与apache一起建立gitlab,但我不知道我的解决方案是否适用于您的情况:
我为子域'gitlab.example.com‘设置了dns记录,以指向域'example.com',并为子域添加了一个虚拟主机。这允许我让代理工作为'/‘而不是'/gitlab’。以下是我的配置文件:
/etc/gitlab/gitlab.rb:
external_url 'http://localhost:81'虚拟主机(in /etc/apache2/apache2.conf)
<VirtualHost *:80>
ServerName gitlab.example.com
ProxyPass / http://localhost:81
ProxyPassReverse / http://localhost:81
</VirtualHost>这样我就可以通过'http://gitlab.example.com‘使用gitlab
https://serverfault.com/questions/686566
复制相似问题