Ruby on rails 3 如何设置ApacheConf和Passenger以允许更多vHost从一个代码库中运行

Ruby on rails 3 如何设置ApacheConf和Passenger以允许更多vHost从一个代码库中运行,ruby-on-rails-3,configuration,apache2,passenger,Ruby On Rails 3,Configuration,Apache2,Passenger,我的代码库在标识符(OXID)上对用户进行分段,但我希望分段的用户有单独的public文件夹,并且我可以在不干扰其他站点的情况下关闭一个站点-这就是为什么我希望我的httpd.conf包含如下所示: <VirtualHost *:80> ServerName ny1.alco.dk DocumentRoot /var/www/html/alco/current/sites/user_A/public PassengerAppRoot /var/www/html

我的代码库在标识符(OXID)上对用户进行分段,但我希望分段的用户有单独的public文件夹,并且我可以在不干扰其他站点的情况下关闭一个站点-这就是为什么我希望我的httpd.conf包含如下所示:

<VirtualHost *:80>
    ServerName ny1.alco.dk
    DocumentRoot /var/www/html/alco/current/sites/user_A/public
    PassengerAppRoot /var/www/html/alco/current
    SetEnv OXID 23
</VirtualHost>

<VirtualHost *:80>
    ServerName ny2.alco.dk
    DocumentRoot /var/www/html/alco/current/sites/user_B/public
    PassengerAppRoot /var/www/html/alco/current
    SetEnv OXID 25
</VirtualHost>

服务器名ny1.alco.dk
DocumentRoot/var/www/html/alco/current/sites/user\u A/public
PassengerAppRoot/var/www/html/alco/current
SetEnv氧化剂23
服务器名ny2.alco.dk
DocumentRoot/var/www/html/alco/current/sites/user\u B/public
PassengerAppRoot/var/www/html/alco/current
SetEnv氧化剂25
Apache对此很酷,但乘客们却叫嚷着“没有这样的文件可以加载——bundler”——显然,这是不对的

这可能吗(至少在Apache/2.2.14(Unix)、Ruby 1.8.7 p330、Rails 3.0.3和Passenger 3.0.2中是这样)

更新
原来乘客“吠叫”是冲着我来的:(


我已经启动并运行了这两个站点,但这两个站点都报告了ENV['OXID']第一个被访问的主机的名称!?例如,如果我浏览ny1.alco.dk/something-我会得到'23',这很好,但是如果我浏览ny2.alco.dk!我也会得到'23'。同样地-如果我在触摸tmp/restart.txt后第一件事就是浏览ny2.alco.dk/something,我会得到'25',这将是我在随后浏览ny1.alco.dk时得到的相同值-嗯嗯

可能是黑客攻击-我需要进一步调查,但:

如果我这样做

ln -s /data/www/html/alco/current ny1
ln -s /data/www/html/alco/current ny2
然后编辑my/data/apache/conf.d/alco.conf以保持

<VirtualHost *:80>
    ServerName ny1.alco.dk
    DocumentRoot /var/www/html/alco/ny1/sites/user_A/public
    PassengerAppRoot /var/www/html/alco/ny1
    SetEnv OXID 23
</VirtualHost>

<VirtualHost *:80>
    ServerName ny2.alco.dk
    DocumentRoot /var/www/html/alco/ny2/sites/user_B/public
    PassengerAppRoot /var/www/html/alco/ny2
    SetEnv OXID 25
</VirtualHost>

服务器名ny1.alco.dk
DocumentRoot/var/www/html/alco/ny1/sites/user\u A/public
PassengerAppRoot/var/www/html/alco/ny1
SetEnv氧化剂23
服务器名ny2.alco.dk
DocumentRoot/var/www/html/alco/ny2/sites/user\u B/public
PassengerAppRoot/var/www/html/alco/ny2
SetEnv氧化剂25
我很好:)


我仍然希望在这个问题上有第二种意见——但现在;我很好:)

Rails 3.2.0包含了一个
config.ru
,它似乎真的是罪魁祸首——完全删除它确实解决了我的多站点问题


所以,到目前为止,我们得到的教训是,若你们喜欢在相似的站点之间共享代码,Rails应用程序并不容易搜索

Shute-没有什么是永恒的:(3.2.0更新,我的“黑客”是历史,有什么想法吗?