我使用Omnibus安装程序安装了GitLab。 目前它正在使用运行在端口81上的Nginx(与GitLab捆绑在一起)正常工作。我从端口80更改为端口81,因为我的Apache运行在端口80上。我还安装了Tomcat并运行在端口8080上,所以我更改了独angular兽端口到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虚拟主机configuration。 我得到的唯一成功是我可以键入URL http://mysite.example.com/gitlab并获得一个404错误,但我看到该URL更改为http://mysite.example.com/users/sign_in 。 redirect导致gitlab被删除,但如果我把它放回来获取URL http://mysite.example.com/gitlab/users/sign_in我可以看到GitLablogin页面,虽然它都被抬起,因为没有的图像是正确的。 我用来实现这些结果的configuration如下:
/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
我有一个类似的问题,想要build立与Apache的gitlab,但我不知道我的解决scheme是否适用于您的情况:
我为子域“gitlab.example.com”设置了dnslogging,指向域“example.com”,并为该子域添加了一个虚拟主机。 这使我有代理工作的'/'而不是'/ gitlab'。 这是我的configuration文件:
/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