简体   繁体   中英

Not a valid directory (didn't found the answer on the net)

Here is my question i have made a standard rail and redmine installation under ubuntu 12. And i have this error : The directory "/var/www" does not appear to be a valid Ruby on Rails application root.

It seems to be a common error but no solution on the net : 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

Here is my default file :

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        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

and my passenger.conf :

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

And i don't understand why ... Regards Bussiere

You should point DocumentRoot tho the public dir inside the rails app

DocumentRoot /var/www/YOUR_APP_NAME/public

[...]

<Directory /var/www/YOUR_APP_NAME/public>

乘客下的Rails应用程序的DocumentRoot应该是该应用程序的public目录。

Some installation instruction had a mistake with simlink creating. The right simlink is the following for using.

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

vhost should be like this:

<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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM