【发布时间】:2017-04-23 18:40:30
【问题描述】:
我已经使用https://about.gitlab.com/downloads/#ubuntu1404 在 Ubuntu 14.04 上成功安装了 Gitlab,但我正在努力进行重定向并通过网络 (https://my.example.com/gitlab) 访问它。
我已将/etc/gitlab/gitlab.rb修改为:
external_url 'https://my.example.com/gitlab'
nginx['enable'] = false
并重新配置为sudo gitlab-ctl reconfigure
如果我取消注释:
web_server['external_users'] = ['www-data']
我明白了:
配方编译错误 /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default
NoMethodError ------------- nil:NilClass 的未定义方法 `-'
食谱追踪: --------------- /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/config.rb:21:in
from_file'from_file'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:26:in
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default.rb:18:in `from_file'相关文件内容: ---------------------- /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/config.rb:
14: # 请参阅许可证以了解具体的管理语言 权限和 15: # 许可证下的限制。 16:#17: 18: Gitlab[:node] = 节点 19: 20: 如果 File.exists?('/etc/gitlab/gitlab.rb') 21>>
Gitlab.from_file('/etc/gitlab/gitlab.rb') 22: 结束 23: 24: node.consume_attributes(Gitlab.generate_config(node['fqdn'])) 25:
我尝试将各种 gitlab.conf 添加到 /etc/apache2/sites-available/ 但 https://my.example.com/gitlab 不会重定向到 Gitlab 登录页面,我从在主页上运行的 Redmine 服务中得到“找不到页面”。当前default-ssl.conf 使用DocumentRoot /var/www 而Gitlab DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public。 Apache2 配置为使用 SSL。
更新 1
我已经做了符号链接:
sudo ln -s /opt/gitlab/embedded/service/gitlab-rails/public /var/www/gitlab
所以现在可以在default-ssl.conf中配置了。
Alias /gitlab "/var/www/gitlab"
不转发到 Gitlab 主页,而
Alias /gitlab "/var/www/gitlab/deploy.html"
效果很好。什么是 Gitlab 主页目录? index.html 文件在哪里?
更新 2
如果我添加
RackBaseURI /gitlab
RailsBaseURI /gitlab
<Directory /var/www/gitlab>
Allow from all
Options -MultiViews
</Directory>
输入https://my.example.com/gitlab/后出现错误
Web 应用程序无法启动
看起来 Bundler 找不到 gem。也许您没有安装此应用程序所需的所有 gem。要安装您的 gem,请运行:
捆绑安装
如果这不起作用,那么问题可能是由于您的应用程序在与预期不同的环境下运行造成的。请检查 > 以下内容:
Is this app supposed to be run as the www-data user? Is this app being run on the correct Ruby interpreter? Below you will see which Ruby interpreter Phusion Passenger attempted to use.-------- 例外情况如下:-------- 在任何源中都找不到 rake-10.5.0 (Bundler::GemNotFound)
/var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/spec_set.rb:95:in
block in materialize' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/spec_set.rb:88:inmap!' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/spec_set.rb:88:inmaterialize' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/definition.rb:140:inspecs' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/definition.rb:185:inspecs_for' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/definition.rb:174:inrequested_specs'
上述异常在更新 Ruby 后得到解决。
更新 3
现在我明白了
与
Alias /gitlab "/var/www/gitlab"
AllowEncodedSlashes NoDecode
<Directory /var/www/gitlab>
Options Indexes FollowSymLinks MultiViews
PassengerAppRoot "/var/www/gitlab"
RailsBaseURI /var/www/gitlab
AllowOverride None
Order allow,deny
allow from all
</Directory>
输入https://my.example.com/gitlab时如何配置Gitlab和Apache2获取Gitlab首页?
【问题讨论】:
标签: apache ubuntu redirect apache2 gitlab