[英]Not a valid directory (didn't found the answer on the net)
这是我的问题,我已经在ubuntu 12下进行了标准的Rail和Redmine安装。而且我遇到此错误:目录“ / 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 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
和我的passenger.conf:
<IfModule mod_passenger.c>
PassengerRoot /usr
PassengerRuby /usr/bin/ruby
PassengerDefaultUser www-data
</IfModule>
而且我不明白为什么...关于Bussiere
您应该将DocumentRoot指向Rails应用程序内的public
目录
DocumentRoot /var/www/YOUR_APP_NAME/public
[...]
<Directory /var/www/YOUR_APP_NAME/public>
乘客下的Rails应用程序的DocumentRoot
应该是该应用程序的public
目录。
某些安装说明在创建simlink时出错。 正确的simlink供以下使用。
sudo ln -s /usr/share/redmine /var/www/redmine
vhost应该是这样的:
<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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.