我是根据这篇教程:http://blog.csdn.net/abbuggy/article/details/8245941,来部署的,过程很顺利,但是网站就是出不来,求各位大侠指点。
系统是 Ubuntu 12.04.3 LTS,先安装 RVM,再安装 Ruby 2.1.1,Rails 4.0.4,以及 Apache 和 Passenger。整个安装过程很顺利,安装完毕后,网站用 rails s -e production 是可以跑起来的。但是用 Apache 就变成了显示网站目录。
Apache: 2.2.22 (Ubuntu 12.04.3 LTS) Passenger: 4.0.40 网站目录: /home/cb/www/blog
Apache 配置文件(/etc/apache2/httpd.conf):
ServerName localhost
   LoadModule passenger_module /home/cb/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.
40/buildout/apache2/mod_passenger.so
   <IfModule mod_passenger.c>
     PassengerRoot /home/cb/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.40
     PassengerDefaultRuby /home/cb/.rvm/gems/ruby-2.1.1/wrappers/ruby
   </IfModule>
   <VirtualHost *:80>
      ServerName test.webcb.net
      # !!! Be sure to point DocumentRoot to 'public'!
      DocumentRoot /home/cb/www
      <Directory /home/cb/www>
         # This relaxes Apache security settings.
         AllowOverride all
         # MultiViews must be turned off.
         Options -MultiViews
      </Directory>
      RailsBaseURI /blog
      <Directory /home/cb/www/blog>
         Options -MultiViews
      </Directory>
   </VirtualHost>
就是显示这种目录,而不是网站,见下图
