Ruby 应用程序仅在 Passenger 被“禁用”时才起作用。
我已经使用 Apache 和 Passenger 在 Ubuntu 服务器上部署了 Sinatra 应用程序。通过一些试验和错误,我意识到该应用程序仅在乘客模块被禁用时才能工作。
$ a2dismod passenger
Apache 重新启动后,应用程序将按预期运行。
如果我重新启用该模块...
$ a2enmod passenger
...我在 Apache 重新启动时看到此警告:
[warn] module passenger_module is already loaded, skipping
并且应用程序停止工作。 Apache 做出响应,提供虚拟主机文档根目录的内容,但 Passenger 无法识别。
我很高兴我的应用程序可以工作,但我不确定如何解释启用/禁用乘客模块的相反效果。
I have deployed a Sinatra application on an Ubuntu server using Apache and Passenger. Through some trial and error, I realize the app only works when the passenger module is disabled.
$ a2dismod passenger
After an Apache restart, the app runs as expected.
If I re-enable the module...
$ a2enmod passenger
...I see this warning upon Apache restart:
[warn] module passenger_module is already loaded, skipping
and the app stops working. Apache responds, serving the contents of the vhost's document root, but is not recognized by Passenger.
I'm glad my app works, but I'm not sure how to explain the reversed effect of enabling/disabling the passenger module.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了同样的问题:如果您遵循此版本 Apache 的乘客安装说明,您实际上可能会告诉 Apache 加载乘客两次。
在将这 3 行著名的行添加到您的 Apache 配置文件之前:
检查配置文件 apache2.conf 中是否存在如下行:
如果这些行确实存在,则意味着在启动时您的 Apache 服务器将包含来自 / 的每个 *.conf 和 *.load 文件mods-available 到 /mods-enabled 并加载它们。
因此,如果您遇到相关警告消息,则意味着您正在加载乘客模块两次!
您可以利用 Apache 的这一功能,转到 /mods-available,查找 Passenger.conf 和 Passenger.load 文件并编辑它们,而不是编辑 apache2.conf。
'LoadModule Passenger_module'行进入passenger.load,而其他2行'PassengerRoot'和'PassengerRuby'行进入passenger.conf。
然后重新启动你的服务器就可以了。
有关此问题的更多信息,请访问:http:// www.duccioarmenise.net/ruby-on-rails/warn-module-passenger_module-is-already-loaded/
I ran into the same problem: if you follow passenger installing instruction with this version of Apache you may actually tell Apache to load passenger twice.
Before adding the 3 famous lines to your Apache configuration file:
Check the configuration file apache2.conf for lines like these:
If these lines do exists it means that on start your Apache server will include every *.conf and *.load file from /mods-available to /mods-enabled and than load them.
So if you run in the concerning warning message it means you are loading passenger module twice!
You can take advantage of this Apache feature going to /mods-available, looking for passenger.conf and passenger.load files and edit them instead of apache2.conf.
The ‘LoadModule passenger_module’ line goes into passenger.load, while the other 2 ‘PassengerRoot’ and ‘PassengerRuby’ lines go into passenger.conf.
Then restart your server and you’ll be fine.
More about this issue here: http://www.duccioarmenise.net/ruby-on-rails/warn-module-passenger_module-is-already-loaded/
这很可能意味着您已指定“LoadModule Passenger_module ...”两次。第一个条目不在passenger.conf 中,第二个条目在passenger.conf 中。
This most likely means you've specified 'LoadModule passenger_module ...' twice. The first entry is somewhere not in passenger.conf, the second entry is in passenger.conf.