gpt4 book ai didi

apache - 带有 SSL 的 Apache2 上的 Gitlab

转载 作者:行者123 更新时间:2023-12-04 18:28:25 26 4
gpt4 key购买 nike

我已经使用 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']



我得到:

Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default

NoMethodError ------------- undefined method `-' for nil:NilClass

Cookbook Trace: --------------- /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/config.rb:21:in from_file'

/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:26:in
from_file'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default.rb:18:in `from_file'

Relevant File Content: ---------------------- /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/config.rb:

14: # See the License for the specific language governing permissions and 15: # limitations under the License. 16: # 17: 18: Gitlab[:node] = node 19: 20: if File.exists?('/etc/gitlab/gitlab.rb') 21>>
Gitlab.from_file('/etc/gitlab/gitlab.rb') 22: end 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

我做了符号链接(symbolic link):
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 application could not be started

It looks like Bundler could not find a gem. Maybe you didn't install all the gems that this application needs. To install your gems, please run:

bundle install

If that didn't work, then the problem is probably caused by your application > being run under a different environment than it's supposed to. Please check > the following:

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.

-------- The exception is as follows: ------- Could not find rake-10.5.0 in any of the sources (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:in
map!' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/spec_set.rb:88:in materialize'
/var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/definition.rb:140:in
specs' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/definition.rb:185:in specs_for'
/var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/definition.rb:174:in
requested_specs'



更新 Ruby 后解决了上述异常。

更新 3

现在我明白了

enter image description here


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 配置没有代理到端口 8080( unicorn )上的 GitLab 服务器。 https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache 上提供了示例 Apache 配置文件。 .

还有一篇很好的文章解释了将 Apache 与 GitLab Omnibus 结合使用的步骤,地址为 http://ryansechrest.com/2015/08/use-apache-instead-of-built-in-nginx-in-gitlab-ce/。 .它已经有一年多的历史了,所以 Apache 配置可能有点过时了。使用指南,但替换 gitlab-recipes 中的 Apache 配置上面的链接,它应该可以工作。

关于apache - 带有 SSL 的 Apache2 上的 Gitlab,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41040867/

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