【问题标题】:No such file or directory - config/environment.rb phusion passenger apache centos 6.3 rails没有这样的文件或目录 - config/environment.rb phusion 乘客 apache centos 6.3 rails
【发布时间】:2012-09-21 02:06:03
【问题描述】:

我正在尝试在我的 apache/rails/phusion 乘客安装中允许子 url,以便我可以在顶层拥有 php 文件,然后在子目录(例如 blog)中使用 rails 应用程序:

我已经按照这里的文档:http://www.modrails.com/documentation/Users%20guide%20Apache.html#deploying_rails_to_sub_uri

这是我的 httpd.conf 虚拟主机条目:

<VirtualHost *:80>
ServerName xx.xx.xx.xx
DocumentRoot /var/www/html
<Directory /var/www/html>
Allow from all
</Directory>
RailsBaseURI /blog
<Directory /var/www/html/blog>   
Options -MultiViews               
</Directory>   
</VirtualHost>

apache 用户拥有 /var/www/html,这是我的快捷链接: http://d.pr/i/aLkP 用 ln 命令制作

这是错误:http://d.pr/i/M3r4

【问题讨论】:

    标签: ruby-on-rails apache centos passenger


    【解决方案1】:

    apache 组还必须能够读取和执行 config 和 public 文件夹以及所有 parent 文件夹。尝试更改权限并重新启动 apache。

    您的符号链接应与子网址同名,因此您的符号链接应命名为“blog”。看起来它现在被命名为“public”。您可能希望将符号链接放在 www 目录中的单独文件夹中。

    【讨论】:

    • 是的,但在这种情况下,还必须为 apache 赋予 /var 组读取/执行权限。还要检查 /var/www/html/、var/www/html/blog 以及应用程序 + railsapp/config 和 railsapp/public 的父目录。
    【解决方案2】:

    我在尝试安装 Redmine 时遇到了同样的问题。为了解决这个问题,我不得不更改/etc/apache2/sites-available/default 并指定PassengerAppRoot

    <Directory /var/www/redmine>
        RailsBaseURI /redmine
        PassengerAppRoot /var/lib/redmine
        PassengerResolveSymlinksInDocumentRoot on
    </Directory>
    

    我还修改了/etc/apache2/mods-available/passenger.conf 并指定了PassengerDefaultUser

    <IfModule mod_passenger.c>
      PassengerRoot /usr
      PassengerRuby /usr/bin/ruby
      PassengerDefaultUser www-data
    </IfModule>
    

    【讨论】:

      猜你喜欢
      • 2023-03-20
      • 1970-01-01
      • 1970-01-01
      • 2012-06-22
      • 1970-01-01
      • 2014-07-03
      • 1970-01-01
      • 2014-01-04
      • 2013-09-09
      相关资源
      最近更新 更多