2011-07-08 25 views
0

不能在Apache的/ var/WWW運行在軌道上的項目紅寶石/不能運行在Apache的/ var/WWW on Rails項目的Ruby/

我安裝在Debian/Ubuntu的:

ii libapache2-mod-fastcgi    2.4.7~0910052141-1       Apache 2 FastCGI module for long-running CGI scripts 
ii libapache2-mod-scgi     1.13-1build1        Apache module implementing the SCGI protocol 
ii libcgic-dev       2.05-2          C library for developing CGI applications 
ii libcgic2        2.05-2          C library for developing CGI applications 
ii libcupscgi1       1.4.6-5ubuntu1        Common UNIX Printing System(tm) - CGI library 
ii libfcgi-ruby1.8      0.8.8-1         FastCGI library for Ruby 
ii libfcgi-ruby1.9.1      0.8.8-1         FastCGI library for Ruby 
ii libfcgi0ldbl       2.4.0-8ubuntu1        Shared library of FastCGI 
ii libgcgi0        0.9.5.dfsg-6        library for CGI programs in C 
ii libapache2-mod-passenger    2.2.11debian-2        Rails and Rack support for Apache2 

把演示/上/無功/網絡/ http://localhost/demo =>我的文件夾/瀏覽器的 文件,我還編輯了apache2.conf: 「貓的/ etc/apache2的/網站可用/默認」

的ServerAdmin webmaster @ localhost

DocumentRoot /var/www 
<Directory /> 
    Options FollowSymLinks 
    AllowOverride None 
</Directory> 
<Directory /var/www/> 
    Options Indexes FollowSymLinks MultiViews 
    #AllowOverride None 
    AllowOverride All 
    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 

Alias /doc/ "/usr/share/doc/" 
<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> 

有人幫,

回答

1

你必須在DocumentRoot指向您的Rails應用程序的公用文件夾。在你的情況下,將是/var/www/demo/publicSee the documentation for more information.

如果這將是一個生產服務器,請向專業人士尋求幫助。否則,你可能會讓你的應用程序(和你的用戶的數據)變得脆弱。