我在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
效果很好。