【发布时间】:2013-07-29 12:53:33
【问题描述】:
我正在尝试设置 gitlab,以便可以通过现有 apache 服务器的子目录访问它,例如,example.com/gitlab。我正在尝试使用乘客,因为这似乎是最容易设置的,但其他解决方案也是可以接受的。不幸的是,为 gitlab 使用单独的虚拟主机不是我的选择。
我的设置
在设置时,我遵循了gitlab setup guide 和passenger documentation。
我认为/etc/httpd/conf/httpd.conf 最相关的部分如下:
DocumentRoot "/home/.www"
# gitlab config
RackBaseURI /gitlab
<Directory "/home/.www/gitlab">
Options -MultiViews
</Directory>
apache 的DocumentRoot 包含指向 gitlab 公共目录的符号链接:
$ ls -l /home/.www
lrwxrwxrwx 1 root http 23 Jul 29 12:35 gitlab -> ../gitlab/gitlab/public
Passenger 是使用passenger-install-apache2-module 脚本安装的,脚本输出的配置行包含在 apache 配置中。
我在config/gitlab.yml中玩过relative_url_root;没有任何效果(从文件中的 cmets 来看,这种机制似乎不鼓励或不赞成使用——最好避免它)。
结果
访问example.com/gitlab 时,我得到以下输出(纯文本文档):
Not Found: /
Apache 的日志显示乘客已启动,但至少从文档根目录请求了 favicon.ico,而此时应该从子目录请求 /gitlab/favicon.ico:
[ 2013-07-29 14:14:12.1029 2037/7f3502e1e740 agents/HelperAgent/Main.cpp:597 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.2033/generation-0/request
[ 2013-07-29 14:14:12.1150 2043/7fa24dbf3740 agents/LoggingAgent/Main.cpp:330 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.2033/generation-0/logging
[ 2013-07-29 14:14:12.1154 2034/7ff20a0cb740 agents/Watchdog/Main.cpp:635 ]: All Phusion Passenger agents started!
[Mon Jul 29 14:14:12 2013] [notice] Digest: generating secret for digest authentication ...
[Mon Jul 29 14:14:12 2013] [notice] Digest: done
[ 2013-07-29 14:14:13.0297 2057/7f5380ee3740 agents/Watchdog/Main.cpp:452 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nobody', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_instances_per_app' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/gems/2.0.0/gems/passenger-4.0.10', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_pid' => '2055', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2013-07-29 14:14:13.0367 2061/7f92eefef740 agents/HelperAgent/Main.cpp:597 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.2055/generation-0/request
[ 2013-07-29 14:14:13.0485 2067/7f4cc5205740 agents/LoggingAgent/Main.cpp:330 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.2055/generation-0/logging
[ 2013-07-29 14:14:13.0490 2057/7f5380ee3740 agents/Watchdog/Main.cpp:635 ]: All Phusion Passenger agents started!
[Mon Jul 29 14:14:13 2013] [notice] Apache/2.2.25 (Unix) mod_ssl/2.2.25 OpenSSL/1.0.1e DAV/2 Phusion_Passenger/4.0.10 configured -- resuming normal operations
[ 2013-07-29 14:14:16.8354 2061/7f92eef2a700 Pool2/Spawner.h:738 ]: [App 2096 stdout]
[ 2013-07-29 14:14:24.8814 2061/7f92eef2a700 Pool2/SmartSpawner.h:301 ]: Preloader for /home/.www/../gitlab/gitlab started on PID 2096, listening on unix:/tmp/passenger.1.0.2055/generation-0/backends/preloader.2096
[Mon Jul 29 14:14:25 2013] [error] [client 129.241.220.221] File does not exist: /home/.www/favicon.ico
在我看来,不需要启动任何 puma 服务器或类似服务器,因此在生成上面的日志时,我没有运行任何 bundle exec rake ... 命令来启动任何与 rails 相关的东西(我已经尝试过了,但我m 不包括此处的输出,因为它似乎与我相同)。
有人看到我做错了吗?
【问题讨论】:
标签: ruby-on-rails-3 apache passenger gitlab