rails应用程序的适当权限

时间:2010-07-14 01:09:25

标签: ruby-on-rails nginx passenger

Nginx给了我403 Forbidden错误。看起来我的权限是错误的。这就是我在本地机器上发生的事情:

  drwx------ 13 sean sean  4096 2010-07-10 13:17 .
  drwxr-xr-x 41 sean sean  4096 2010-07-13 17:55 ..
  drwx------  6 sean sean  4096 2010-07-09 16:45 app
  drwx------  5 sean sean  4096 2010-07-13 17:54 config
  drwx------  3 sean sean  4096 2010-06-20 14:44 db
  drwx------  2 sean sean  4096 2010-06-20 14:31 doc
  drwx------  3 sean sean  4096 2010-06-20 14:31 lib
  drwx------  2 sean sean  4096 2010-06-20 14:31 log
  drwx------  5 sean sean  4096 2010-07-10 20:28 public
  -rwxr-xr-x  1 sean sean   307 2010-06-20 14:31 Rakefile
  -rwxr-xr-x  1 sean sean 10011 2010-06-20 14:31 README
  drwx------  3 sean sean  4096 2010-06-20 14:31 script
  drwx------  7 sean sean  4096 2010-06-20 14:31 test
  drwx------  6 sean sean  4096 2010-06-20 14:31 tmp
  drwx------  3 sean sean  4096 2010-06-20 14:31 vendor

/公共

  drwx------  5 sean sean 4096 2010-07-10 20:28 .
  drwx------ 13 sean sean 4096 2010-07-10 13:17 ..
  -rwxr-xr-x  1 sean sean  947 2010-06-20 14:31 404.html
  -rwxr-xr-x  1 sean sean  930 2010-06-20 14:31 422.html
  -rwxr-xr-x  1 sean sean  948 2010-06-20 14:31 500.html
  -rwxr-xr-x  1 sean sean    0 2010-06-20 14:31 favicon.ico
  drwx------  2 sean sean 4096 2010-06-20 14:31 images
  drwx------  2 sean sean 4096 2010-06-20 14:31 javascripts
  -rwxr-xr-x  1 sean sean  204 2010-06-20 14:31 robots.txt
  drwx------  2 sean sean 4096 2010-07-09 09:58 stylesheets

/ config

  drwx------  5 sean sean 4096 2010-07-13 17:54 .
  drwx------ 13 sean sean 4096 2010-07-10 13:17 ..
  -rwxr-xr-x  1 sean sean 2795 2010-06-20 14:31 boot.rb
  -rwxr-xr-x  1 sean sean 1351 2010-07-13 17:54 database.yml
  -rwxr-xr-x  1 sean sean 2133 2010-07-10 12:49 environment.rb
  -rwxr-xr-x  1 sean sean 2074 2010-07-09 16:40 environment.rb~
  drwx------  2 sean sean 4096 2010-07-10 12:58 environments
  drwx------  2 sean sean 4096 2010-07-10 12:54 initializers
  drwx------  2 sean sean 4096 2010-06-20 14:31 locales
  -rwxr-xr-x  1 sean sean 2212 2010-07-13 17:54 routes.rb

设置权限的最佳方法是什么?

 server {
    listen       80;
    server_name  name.org;
    root /path/public;

    passenger_enabled on;
    rails_env production;
  }

1 个答案:

答案 0 :(得分:0)

尝试使公众可读的chmod -R 755 public/