2012-10-04 28 views
0

我正在使用linode vps部署rails應用程序我已成功安裝ruby和rails,mysql和apache與乘客。如何在ubuntu 11.10中爲Rails應用程序配置apache乘客

這裏是在/ etc我的主機文件/主機

 127.0.0.1       localhost.localdomain localhost 
    198.58.100.126      foo.qitch1.com  foo 

,我也複製一些行httpd.conf文件安裝後,乘客

LoadModule passenger_module /usr/local/rvm/gems/[email protected]/gems/passenger-3.0.17/ext/apache2/mod_passenger.so 

    PassengerRoot /usr/local/rvm/gems/[email protected]/gems/passenger-3.0.17 

    PassengerRuby /usr/local/rvm/wrappers/[email protected]/ruby 

它包括apache2.conf

現在我使用/ generate_pdf.com在/ atc/apache2/sites_available中創建文件

其中generate_pdf是我app.and的名字此文件具有代碼

  NameVirtualHost *:80 

<VirtualHost *:80> 
    ServerName aziz.qitch1.com 
    DocumentRoot /var/www/generate_pdf/public 
    RailsEnv production 
    <Directory /var/www/generate_pdf/public> 
    Allow from all 
    Options -MultiViews 
    </Directory> 
</VirtualHost> 

但是當我啓動服務器,我訪問這個URL aziz.qitch1.com

沒有被加載和我有這個殼

 NameVirtualHost *:80 has no VirtualHosts 

請幫助

回答

0

我工作的相關問題,以及跨http://old.thoughtsincomputation.com/posts/using-phusion-passenger-and-apache2-on-ubuntu-with-rvm-and-gemsets來了,這說明把虛擬主機代碼/etc/apache2/conf.d/virtual.conf。這解決了我的問題,也可以幫助你。

請注意,我沒有足夠的文章使用了IfModule,我的虛擬主機代碼只是如下:

<VirtualHost *:80> 
    ServerName www.yournamehere.com 
    # !!! Be sure to point DocumentRoot to 'public'! 
    DocumentRoot /rails_app_folder/app_name/public 
    <Directory /rails_app_folder/app_name/public> 
     # This relaxes Apache security settings. 
     AllowOverride all 
     # MultiViews must be turned off. 
     Options -MultiViews 
    </Directory> 
</VirtualHost> 
相關問題