And*_*own 3 apache ruby-on-rails
我想在 Rails 应用程序的“public/”目录的特定子目录上启用 Apache 目录列表。为了这个讨论,我们假设它是“public/listme”
我已经设置了 Apache 选项来启用目录列表,但是如果我请求类似的东西http://mydomain.com/listme,我会收到 404 错误,如果我检查 Rails 日志,我会收到类似的错误:
ActionController::RoutingError (No route matches "/listme")
那么:有没有办法禁用 Rails 应用程序中特定文件夹的路由并允许 Apache 的自动目录列表启动?
小智 5
事实证明,这个问题在 modrails 文档中得到了回答。请参阅http://www.modrails.com/documentation/Users%20guide%20Apache.html
总之 :
假设您在 /apps/foo 中有一个 Rails 应用程序。假设您已删除 Wordpress?—?用 PHP 编写的博客应用程序?—?在 /apps/foo/public/wordpress 中。然后,您可以按如下方式配置 Phusion 乘客:
<VirtualHost *:80>
ServerName www.foo.com
DocumentRoot /apps/foo/public
<Directory /apps/foo/public/wordpress>
PassengerEnabled off
AllowOverride all # <-- Makes Wordpress's .htaccess file work.
</Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
855 次 |
| 最近记录: |