Ruby on rails 在具有相同IP的单个服务器上托管两个rails应用程序

Ruby on rails 在具有相同IP的单个服务器上托管两个rails应用程序,ruby-on-rails,ruby-on-rails-3,ruby-on-rails-4,hosting,Ruby On Rails,Ruby On Rails 3,Ruby On Rails 4,Hosting,我有一台运行rails 3.2应用程序的服务器。它在端口3000上运行精简服务器,在443上运行apache(代理)服务器 如果我尝试在同一台服务器上托管另一个rails应用程序,方法是在/www下创建一个文件夹,使其在端口3002或任何其他端口上运行,然后在其他端口上运行另一个apache for proxy,这是否可能 我创建的新rails应用程序是在带有Ruby 2.0的rails 4中 请指导。为端口3002添加另一个VirtualHost <VirtualHost *:3002&

我有一台运行rails 3.2应用程序的服务器。它在端口3000上运行精简服务器,在443上运行apache(代理)服务器

如果我尝试在同一台服务器上托管另一个rails应用程序,方法是在/www下创建一个文件夹,使其在端口3002或任何其他端口上运行,然后在其他端口上运行另一个apache for proxy,这是否可能

我创建的新rails应用程序是在带有Ruby 2.0的rails 4中


请指导。

为端口3002添加另一个
VirtualHost

<VirtualHost *:3002>
    ServerName your-server-name
    DocumentRoot /www/your-second-app-public-folder-path

    <Directory /www/your-second-app-public-folder-path>
        AllowOverride all
        Options -MultiViews
    </Directory>
</VirtualHost>

服务器名称您的服务器名称
DocumentRoot/www/您的第二个应用程序公用文件夹路径
允许超越所有
选项-多视图

使用主机虚拟主机配置为同一ip指定不同的端口

 You have multiple domains going to the same IP and also want to serve multiple ports. By defining the ports in the "NameVirtualHost" tag, you can allow this to work. If you try using <VirtualHost name:port> without the NameVirtualHost name:port or you try to use the Listen directive, your configuration will not work. 
您有多个域连接到同一IP,并且还希望为多个端口提供服务。通过在“NameVirtualHost”标记中定义端口,您可以让它工作。如果尝试在不使用名称virtualhost name:port的情况下使用,或者尝试使用Listen指令,则配置将无法工作。
提及

服务器配置

听80
听8080
NameVirtualHost 172.20.30.40:80
NameVirtualHost 172.20.30.40:8080
服务器名www.example.com
DocumentRoot/www/domain-80
服务器名www.example.com
DocumentRoot/www/domain-8080

这意味着,我可以将端口号和应用程序文件夹路径添加到httpd.conf中,而不需要为精简服务器或重新启动精简服务器进行其他设置?
Listen 80
Listen 8080

NameVirtualHost 172.20.30.40:80
NameVirtualHost 172.20.30.40:8080

<VirtualHost 172.20.30.40:80>
ServerName www.example.com
DocumentRoot /www/domain-80
</VirtualHost>

<VirtualHost 172.20.30.40:8080>
ServerName www.example.com
DocumentRoot /www/domain-8080
</VirtualHost>