【问题标题】:Permission Issue on Ubuntu with Rails App带有 Rails 应用程序的 Ubuntu 上的权限问题
【发布时间】:2013-02-16 14:08:27
【问题描述】:

我的 Ubuntu/Apache/Passenger 服务器上的 Rails 存在权限问题。

当我查看我的 Apache error_log 文件时,我看到:

ActionView::Template::Error (Permission denied - /opt/bitnami/apps/tradelogs/tmp/cache/790):
  78:
  79: <% end %>
  80:
  81: <% cache do %>

当我查看我的目录时,我看到了 (because I Passenger seems to use this as the user):

-rwxr-xr-x 1 bitnami daemon  154 Feb 28 04:42 config.ru
-rwxr-xr-x 1 bitnami daemon   147 Feb 28 04:42 environment.rb

对于 tmp/cache 目录(缓存中没有 790 文件 - 我不确定是否要创建一个):

drwxr-xr-x 6 bitnami daemon 4096 Feb 28 04:44 tmp
drwxr-xr-x 4 bitnami daemon 4096 Feb 28 05:42 tmp/cache

在我的 Apache httpd.conf 文件中,我有这个:

User bitnami
Group daemon

<VirtualHost *:80>
  DocumentRoot /home/bitnami/apps/tradelogs/public
  <Directory /home/bitnami/apps/tradelogs/public>
    Allow from all
    Options -MultiViews
  </Directory>
</VirtualHost>

我尝试过的事情:

  • chmod -R 775, 755 在所有目录中
  • httpd.conf 中的usergroup 更改为daemonbitnami

谁能帮我找出我的授权错在哪里?

【问题讨论】:

    标签: ruby-on-rails linux apache ubuntu actionview


    【解决方案1】:

    您在rake assets:precompile之前或之后更改了权限

    另外,您是否在更改权限后重新启动了 Web 服务?

    sudo /etc/init.d/apache2 restart

    【讨论】:

    • 好的,我又做了rake assets:precompile,因为我是在更改权限之前编译的。但是,在这样做之后,我仍然遇到同样的错误,并停止并重新启动服务器。
    • 运行 ps aux 并查看运行 apache/passenger 实例的用户
    • 我运行了它,但不是 100% 确定我在寻找什么命令 - 结果如下:gist.github.com/ryanchin/5073948
    • 你那里没有 Apache,我也面临同样的问题,但我使用 ps -ef 并得到 /opt/bitnami/apache2/bin/httpd -f /opt/bitnami/apache2/conf/httpd...
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-06
    • 2015-04-05
    • 2023-03-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多