gpt4 book ai didi

ruby-on-rails - 2 个事件的 Rails 应用程序,1 个 Apache/乘客服务器?

转载 作者:太空宇宙 更新时间:2023-11-03 16:59:32 26 4
gpt4 key购买 nike

谁有关于如何设置 apache 和 passenger 以同时运行两个事件的 Rails 应用程序的好教程?我试图让一个在端口 80 上运行,另一个在端口 3001 上运行。我已经知道如何设置 1 个应用程序,但不确定如何同时运行 2 个应用程序。

我找到了这个 - http://renderedtext.com/blog/2009/09/14/running-a-rails-app-on-passenger-on-a-different-port/

但这只是让我半途而废。顺便说一句,如果有帮助,我也在使用 capistrano。我使用 Ubuntu 12.04 作为服务器。

最佳答案

如果您点击了该链接,那么您已经熟悉了虚拟主机。您所需要的只是再创建一个虚拟主机。一个好的方法是在 /etc/apache2/sites-available 中再创建一个文件(apache 的路径可能会有所不同)并将该文件的链接放入 sites-enabled文件夹。在该文件中,您应该像往常一样描述您的虚拟主机,但指定一个端口:

<VirtualHost *:3001>
ServerAdmin webmaster@localhost

DocumentRoot /var/sites/some_site/current/public
ServerName sub.domain.ru

#more params here
</VirtualHost>

不要忘记重新启动重新加载 apache 以应用更改的效果。如果这不起作用,请检查您的 apache2.conf 中是否有以下几行:

# Include the virtual host configurations:
Include sites-enabled/

关于ruby-on-rails - 2 个事件的 Rails 应用程序,1 个 Apache/乘客服务器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20229288/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com