0

我知道 rails 是 ruby​​ 框架,而 apache 是 rails 的服务器。而 Phusion Passenger 是用来做什么的?它是服务器还是部署工具?

现在我正在尝试在服务器上部署我的 rails 应用程序,而我不知道如何使用 Phusion Passenger 和 apache 来运行我的应用程序):

提前致谢

4

1 回答 1

3

Phusion Passenger 只是一个 apache mod,需要在您的应用程序使用的虚拟主机中激活,告诉 apache 使用的是哪个版本的 Rails 以及其他类似的配置。所以基本上,Apache 使用Passenger 来运行Ruby on Rails 应用程序。

您必须阅读此内容才能安装Passenger:https ://www.phusionpassenger.com/download(只需向下滚动一点以阅读开源版本文档)。

这是为了设置它并为您的一个应用程序运行它:http ://www.modrails.com/documentation/Users%20guide%20Apache.html#_configuring_phusion_passenger所以,是的,这里有很多文字,但你幸运的是,不需要阅读所有内容。

此外,当您安装它时,Passenger 会准确地告诉您在虚拟主机配置中要写什么,基本上只有 2 行文本。:)

大多数情况下,如果您有一个看起来像这样的虚拟主机:

<VirtualHost *:80>
    ServerName www.wsgiapp.com
    DocumentRoot /webapps/wsgiapp/public
    <Directory /webapps/wsgiapp/public>
        Allow from all
        Options -MultiViews
    </Directory>
</VirtualHost>

安装后,Passenger 会告诉你写这样的东西:

<VirtualHost *:80>
    ServerName www.wsgiapp.com
    DocumentRoot /webapps/wsgiapp/public

    PassengerRuby /usr/bin/ruby
    PassengerRoot /somewhere/passenger/x.x.x

    <Directory /webapps/wsgiapp/public>
        Allow from all
        Options -MultiViews
    </Directory>
</VirtualHost>
于 2013-01-29T15:09:51.677 回答