当使用多个rails应用程序的目录设置时,apache显示我的rails应用程序的目录结构

时间:2014-09-09 10:46:46

标签: ruby-on-rails apache

我在httpd.conf上有这个

LoadModule passenger_module /usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.42/buildout/apache2/mod_passenger.so 
PassengerRoot /usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.42 
PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-2.1.1/ruby 

RackEnv development

<VirtualHost *:3000>
    ServerName [ip]
    DocumentRoot /var/www/html/apps
    <Directory /var/www/html/apps>
        AllowOverride all
        Options -MultiViews
    </Directory>

    RackBaseURI /app1
    <Directory /var/www/html/apps/app1/public>
        AllowOverride all
        Options -MultiViews
    </Directory>

    RackBaseURI /app2
    <Directory /var/www/html/apps/app2/public>
        AllowOverride all
        Options -MultiViews
    </Directory>
</VirtualHost>

访问[ip]:3000/app1[ip]:3000/app2只显示目录结构,而不是运行rails应用。但是如果我尝试使用下面的单个项目

LoadModule passenger_module /usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.42/buildout/apache2/mod_passenger.so 
PassengerRoot /usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.42 
PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-2.1.1/ruby 

RackEnv development

<VirtualHost *:3000>
     ServerName [ip]
     DocumentRoot /var/www/html/apps/app1/public
     <Directory /var/www/html/apps/app1/public>
         AllowOverride all
         Options -MultiViews
     </Directory>
</VirtualHost>

访问[ip]:3000效果很好。

0 个答案:

没有答案