无法在apache / var / www /
下的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
将demo / on / var / www / http://localhost/demo =>我在浏览器上找到了文件夹/文件 我还编辑了apache2.conf:“cat / etc / apache2 / sites-available / default”
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>
有人请帮忙,
答案 0 :(得分:1)
您必须将DocumentRoot
指向您的Rails应用的公用文件夹。在你的情况下,/var/www/demo/public
。 See the documentation for more information.
如果要成为生产服务器,请向专业人士寻求帮助。否则,您可能会使您的应用程序(以及您的用户数据)容易受到攻击。
答案 1 :(得分:0)
除了@Wukerplank ......
根据您发布的内容,您似乎没有配置Phusion Passenger(a.k.a. mod_rails)
以下是Passenger configuration文档的链接。