乘客和Apache2的显示文件目录结构,而不是应用程序 [英] Passenger and Apache2 Display File Directory Structure rather than application
问题描述
我安装导轨上的乘客和3.0.9 Apache2的应用程序。但是,当通过的Apache2即HTTP /执行铁轨本地主机它显示了Rails应用程序文件structure.and不运行应用程序。我的日志
[周六11月12日21时20分36秒2011] [声明]的Apache / 2.2.17(Ubuntu的)
Phusion_Passenger / 2.2.11 PHP / 5.3.5-1ubuntu7.3用了Suhosin-补丁
配置 - 恢复正常运作。
块引用><虚拟主机*:80>
服务器名本地主机
的DocumentRoot的/ var / WWW / PROJECT_NAME
<目录/ var / WWW / PROJECT_NAME>
选择指数的FollowSymLinks -MultiViews的AllowOverride所有令允许,拒绝允许从所有
< /目录>
< /虚拟主机>
解决方案设置了DocumentRoot为您的公共文件夹,以便:
的DocumentRoot的/ var / WWW / PROJECT_NAME /公
在,如果你用Capistrano的部署生产,这将有可能成为
的DocumentRoot的/ var / WWW / PROJECT_NAME /电流/公
您还需要更新您的目录设置到公用文件夹以及。
如果您的虚拟主机没有指向公用文件夹Apache不知道从哪里适当满足您的应用程序的资产。
I setup rails app on passenger-3.0.9 and apache2. But when in execute rails through apache2 i.e http/localhost it shows the rails app file structure.and not run the app. My logs are
[Sat Nov 12 21:20:36 2011] [notice] Apache/2.2.17 (Ubuntu) Phusion_Passenger/2.2.11 PHP/5.3.5-1ubuntu7.3 with Suhosin-Patch configured -- resuming normal operations
<VirtualHost *:80> ServerName localhost DocumentRoot /var/www/project_name <Directory /var/www/project_name> Options Indexes FollowSymLinks -MultiViews AllowOverride all Order allow,deny allow from all </Directory> </VirtualHost>
解决方案Set your DocumentRoot to your public folder so:
DocumentRoot /var/www/project_name/public
In production if you deploy with capistrano this would likely become
DocumentRoot /var/www/project_name/current/public
You also need to update your Directory setting to the public folder as well.
If your virtual host isn't pointing to your public folder Apache doesn't know where to serve your applications assets from properly.
这篇关于乘客和Apache2的显示文件目录结构,而不是应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!