使用 Phusion Passenger 在 Debian 上设置 Redmine,静态内容不会显示

使用 Phusion Passenger 在 Debian 上设置 Redmine,静态内容不会显示

我和其他一些人正在运行 Apache 的 Debian 服务器上设置 Redmine。实际上,我没有进行初始设置,但我现在无法联系到进行初始设置的人,所以我在这里询问。

我们正在使用 Phusion Passenger 来提供 Ruby 内容(我想,我对 Apache 非常不熟悉),Redmine 显示正常,但没有显示任何静态内容(css、图像、js),当我尝试转到 myurl/redmine/images 或 /stylesheets 时,我得到一个 404 页面,我认为它源自 Phusion Passenger。这似乎应该是显而易见的,但我不知道哪里出了问题。公共目录中有一个 .htaccess 文件,我重命名了它,因为另一个网站上有人提到 .htaccess 文件会导致 Phusion Passenger 出现问题,但即使重新启动 Apache 后,我仍然看不到图像或样式表。

该服务器还运行着我们的主要网站,该网站用 Django 编写,并在 mod_python 上运行,还有一些 PHP 内容和一些其他 Python 但非 Django 的内容。httpd.conf 的相关部分如下:

<Location "/redmine">
    PassengerEnabled on
    SetHandler none
    PassengerAppRoot /var/www/redmine/
    RailsBaseURI    /redmine
</Location>

答案1

您可能需要/redmine将别名化/var/www/redmine/public,或者可能需要文件存在条件的本地重写。不过,我相信 Google 上有很多“如何使用 Passenger 设置 Rails 应用程序”指南,而且他们可能会有更合适的信息。

答案2

您必须将 Redmine 中的 /public 文件夹指定为 DocumentRoot。以下配置在 VirtualHost 指令中可以正常工作。

ServerName redmine.example.com
ServerAdmin [email protected]
DocumentRoot /var/www/redmine/public

有关详细信息,请参阅: http://www.modrails.com/documentation/Users%20guide%20Apache.html#_deploying_a_ruby_on_rails_application

相关内容