例如,我正在尝试设置 gitlab,以便可以通过现有 apache 服务器的子目录访问它example.com/gitlab
。我正在尝试使用乘客,因为这似乎是最容易设置的,但其他解决方案也是可以接受的。不幸的是,为 gitlab 使用单独的虚拟主机不是我的选择。
我的设置
在进行设置时,我遵循了gitlab 设置指南和乘客文档。
我认为最相关的部分/etc/httpd/conf/httpd.conf
如下:
DocumentRoot "/home/.www"
# gitlab config
RackBaseURI /gitlab
<Directory "/home/.www/gitlab">
Options -MultiViews
</Directory>
DocumentRoot
apache 包含一个指向 gitlab 公共目录的符号链接:
$ ls -l /home/.www
lrwxrwxrwx 1 root http 23 Jul 29 12:35 gitlab -> ../gitlab/gitlab/public
乘客是使用passenger-install-apache2-module
脚本安装的,脚本输出的配置行包含在 apache 配置中。
我玩过relative_url_root
in config/gitlab.yml
; 这没有任何效果(从文件中的注释来看,这种机制似乎不鼓励或不推荐使用——避免它会很好)。
结果
访问时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 相关的内容(我已经尝试过,但我不包括此处的输出因为它似乎与我相同)。
有谁看到我做错了什么?