Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I asked this over at stackoverflow as well, but still haven't received any answers that have helped me to solve this problem. I have spent almost a week at this point trying to solve the issue, and I'm just not making any headway. It seems that this issue is pretty common, but none of the solutions I found online work for me. A buddy of mine is actually creating the same setup, and he is having the same issue.

After a few days stuck with the 403 error I started over using this tutorial: http://blog.ninjahideout.com/posts/a-guide-to-a-nginx-passenger-and-rvm-server

I had hoped starting from scratch using this tutorial would work, but no dice. Either way, if you view the tutorial you can see what steps I have taken.

Here is essentially what I have going on.

  1. I have a VPS account on linode.com
  2. Server OS is Ubuntu 10.04
  3. Local OS (shouldn't matter, but just so you know) used to deploy with Capistrano is Snow Leopard 10.6.6
  4. I use RVM on the server. Version is 1.2.2
  5. I was previously on ruby-1.9.2-p0 [ i386 ], but per the tutorial listed above I switched to ree-1.8.7-2010.02 [ i386 ].
  6. Running 'which ruby' from the command line verifies that I am using 1.8.7 with the following output: /usr/local/rvm/rubies/ree-1.8.7-2010.02/bin/ruby
  7. passenger -v prints the following: Phusion Passenger version 3.0.2
  8. Running 'nginx -v' gives me a message that the command nginx could not be found. The server is definitely there and running as I can use nginx to serve static files, but this could have something to do with my problem.
  9. I have two users dealing with the install. root which I used to install everything, and deployer which is a user I created specifically to for deploying my applications
  10. My web app directory is in the deployer user's home directory as follows: /home/deployer/webapps/mysite.com/public
  11. Per Capistrano default deploy, a symbolic link called current is created in the public folder, and points to /home/deployer/webapps/mysite.com/public/releases/most_current_release
  12. I have chmodded the deployer directory recursively to 777
  13. /opt/nginx permissions: rwxr-xr-x
  14. /usr/local/rvm/gems/ree-1.8.7-2010.02/gems/passenger-3.0.2 permissions: rwxrwsrwx
  15. My nginx config file has gone through just short of eternity variations, but currently looks like this:

==================================================================================

worker_processes  1;

events {
    worker_connections  1024;
}


http {
    passenger_root /usr/local/rvm/gems/ree-1.8.7-2010.02/gems/passenger-3.0.2;
    passenger_ruby /usr/local/rvm/bin/passenger_ruby;

    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;

    keepalive_timeout  65;

    server {
       # listen      *:80;
        server_name mysite.com www.mysite.com;
        root   /home/deployer/webapps/mysite.com/public/current;

        passenger_enabled on;
        passenger_friendly_error_pages on;


        access_log logs/mysite.com/server.log;
        error_log logs/mysite.com/error.log info;

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

==================================================================================

I bounce nginx, hit the site, and boom. 403, and logs say directory index of /home/deployer... is forbidden

As others with a similar problem have said, you can drop an index.html into the public/releases/current_release and it will render. But rails no worky.

That's basically it. At this point I have just about completely exhausted every possible solution attempt I can think of. I am a programmer and definitely not a sysadmin, so I am 99% sure this has something to do with permissions that I have hosed, but for the life of me I just can't figure out where.

If anyone can help I would really really appreciate it. If there's any specific permission things you want me to check (ie groups/permissions), can you please include the commands to do so as well. Hopefully this will help others in the future who read this post.

Let me know if there is any other information I can provide, and thanks in advance!!!

share|improve this question
add comment

3 Answers

Please make sure the user nginx running, in most case it's nobody, has permission to read your home directory; or modify nginx.conf, use another user to start worker process.

share|improve this answer
add comment

Hm:

root   /home/deployer/webapps/mysite.com/public/current;

Shouldn't that be this?

root   /home/deployer/webapps/mysite.com/current/public;
share|improve this answer
    
Just tried it. No dice. Still gives me a 403. –  slimchrisp Jan 26 '11 at 16:58
add comment

I would check following :

Your paths seems to be messed up.

/home/deployer/webapps/mysite.com/public/releases/most_current_release

should look like

/home/deployer/webapps/mysite.com/live/current/public

and

/home/deployer/webapps/mysite.com/live/current

should be link to

/home/deployer/webapps/mysite.com/live/releases/most_current_release

typically capistrano directory structure is following

  • [deploy_to]
  • [deploy_to]/releases
  • [deploy_to]/releases/20080819001122
  • [deploy_to]/releases/...
  • [deploy_to]/shared
  • [deploy_to]/shared/log
  • [deploy_to]/shared/pids
  • [deploy_to]/shared/system
  • [deploy_to]/current link to -> [deploy_to]/releases/20100819001122

where deploy_to is yours /home/deployer/webapps/mysite.com/live

hope it helps

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.