使用Phusion Passenger将Rails应用程序部署到LAMP服务器



我刚刚完成了我的第一个rails应用程序的工作,并准备部署到我的VPS。我决定尝试使用Phusion Passenger,并经历了极其简单的安装过程。我得到了所有正确的依赖项,所以在这方面,事情似乎还不错。我认为我的问题在于路由和apache配置文件。

我在以下文件的末尾添加了以下内容:/etc/apache2/apache2.conf

LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-3.0.8/ext/apache2/mod_passenger.so
PassengerRoot /var/lib/gems/1.8/gems/passenger-3.0.8
PassengerRuby /usr/bin/ruby1.8

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot /home/bl/gfy/public
    <Directory /home/bl/gfy/public>
        Allow from all
        Options -MultiViews
    </Directory>
</VirtualHost>

当我重新启动apache时,我得到以下消息:

* Restarting web server apache2                                                                                                                                        [Wed Aug 10 03:16:24 2011] [warn] module passenger_module is already loaded, skipping
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
 ... waiting [Wed Aug 10 03:16:26 2011] [warn] module passenger_module is already loaded, skipping
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

当我将浏览器指向我设置的IP时,我会指向apache附带的示例文件,而不是指向我的rails应用程序。

如有任何意见,不胜感激。

谢谢。

与您的问题有些无关,但仍然

您看到的两个警告都不是重要的,不应该影响服务器的操作。一个意味着您的服务器主机名没有设置,另一个只是提醒您乘客已经从某处加载,可能是在它偶然发现/etc/apache/modules.d之后。

总而言之,您并不是真的想编辑/etc/apache/apache2.conf。而是使用现有结构,如/etc/apache2/sites-available

现在回到你的问题。

你的虚拟主机很可能被默认主机覆盖。在shell中执行sudo a2dissite default将禁用它。

最新更新