2012-05-20 43 views
1

這裏是我的問題,我已經做了標準的鐵路和redmine安裝在Ubuntu 12下。 而我有這個錯誤: 目錄「/ var/www 「似乎不是有效的Ruby on Rails應用程序根目錄。沒有一個有效的目錄(沒有在網上找到答案)

這似乎是一個常見的錯誤,但在網絡上無解: http://www.google.fr/search?q=The+directory+%22%2Fvar%2Fwww%22+does+not+appear+to+be+a+valid+Ruby+on+Rails+application+root.+&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:fr:official&client=firefox-a

這是我的默認文件:

<VirtualHost *:80> 
     ServerAdmin [email protected] 

     DocumentRoot /var/www 


<Directory /> 
       Options FollowSymLinks 
       AllowOverride None 
     </Directory> 
     <Directory /var/www/> 
       Options Indexes FollowSymLinks MultiViews 
       AllowOverride None 
       Order allow,deny 
       allow from all 
     </Directory> 

     ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 
     <Directory "/usr/lib/cgi-bin"> 
       AllowOverride None 
       Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch 
       Order allow,deny 
       Allow from all 
     </Directory> 

     ErrorLog ${APACHE_LOG_DIR}/error.log 

     # Possible values include: debug, info, notice, warn, error, crit, 
     # alert, emerg. 
     LogLevel warn 

     CustomLog ${APACHE_LOG_DIR}/access.log combined 


    <Directory "/usr/share/doc/"> 
     Options Indexes MultiViews FollowSymLinks 
     AllowOverride None 
     Order deny,allow 
     Deny from all 
     Allow from 127.0.0.0/255.0.0.0 ::1/128 
    </Directory> 

PassengerDefaultUser www-data 
RailsEnv production 
RailsBaseURI /redmine 
<Directory /var/www/redmine/> 

AllowOverride None 
AddHandler fcgid-script .fcgi 
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch 
Order allow,deny 
Allow from all 

PassengerEnabled on 
RailsBaseURI /redmine 
PassengerResolveSymlinksInDocumentRoot on 
</Directory> 


</VirtualHost> 
Include /etc/apache2/mods-available/passenger.conf 

和我passenger.conf:

<IfModule mod_passenger.c> 
    PassengerRoot /usr 
    PassengerRuby /usr/bin/ruby 
    PassengerDefaultUser www-data 
</IfModule> 

我不明白爲什麼... Regards Bussiere

回答

5

您應該指向的DocumentRoot壽Rails應用程序

DocumentRoot /var/www/YOUR_APP_NAME/public 

public DIR [...]

<Directory /var/www/YOUR_APP_NAME/public> 
+0

這是由於 – user462794

1

DocumentRoot對於Passenger下的Rails應用程序應該是應用程序的public目錄。

+0

是它是Thaanks – user462794

1

一些安裝說明曾與simlink創建一個錯誤。 正確的simlink是以下使用。

sudo ln -s /usr/share/redmine /var/www/redmine

虛擬主機應該是這樣的:

<VirtualHost *:80> 
    ServerName redmine.yourdomain.tld 

    DocumentRoot /var/www/redmine/public 

    PassengerMaxPoolSize 4 
    PassengerDefaultUser www-data 
    RailsEnv production 
    RailsBaseURI/ 

    <Directory /var/www/redmine/public> 
    Options FollowSymLinks 
    AllowOverride None 
    Order allow,deny 
    Allow from all 
    </Directory> 

    LogLevel info 
    ErrorLog /var/log/apache2/redmine-error.log 
    CustomLog /var/log/apache2/redmine-access.log combined 
</VirtualHost> 
相關問題