I'm trying to deploy a rails application to a Ubuntu server running passenger and nginx. The server was operational for about a year on ruby 1.8, but I recently upgraded to 1.9.3 (this time using RVM) and as a result had to reinstall everything. I am currently running into two problems:
403 forbidden error
I was able to start the nginx server, but when I try to access the rails application, I receive a 403 Forbidden error that reads:
*2177 directory index of "/srv/myapp/public/" is forbidden
I did some looking around in the nxinx help docs and made sure that the /srv/myapp/ directory has the proper permissions. It is owned by a deploy user that owns the worker process of nginx, and is set chmod 755.
Nginx and Passenger installation problems
When I restart the nginx server, I also receive another error in indicating a problem with my phusion passenger installation:
Unable to start the Phusion Passenger watchdog because its executable (/usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.13/agents/ PassengerWatchdog) does not exist. This probably means that your Phusion Passenger installation is broken or incomplete, or that your 'passenger_root' directive is set to the wrong value. Please reinstall Phusion Passenger or fix your 'passenger_root' directive, whichever is applicable.
I reinstall the passenger gem from my non-root (but sudo enabled) user, and reinstall nginx using rvmsudo passenger-install-nginx-module, but then I get this error repeatedly:
Your RVM wrapper scripts are too old. Please update them first by running 'rvm get head && rvm reload && rvm repair all'.
I performed the RVM reload (both with rvmsudo and without) and the error still appears. I tried performing the nginx install without rvmsudo, but ran into permissions problems because I couldn't edit the /opt/nginx/ directory (where I have nginx installed). Now I don't even get that far, because the installer fails to pass the required software check.
Background information
This is what my nginx process currently looks like:
PID PPID USER %CPU VSZ WCHAN COMMAND
10174 1 root 0.0 18480 ? nginx: master process /opt/nginx/sbin/nginx
29418 10174 deploy 0.3 18496 ? nginx: worker process
29474 12266 1001 0.0 4008 - egrep (nginx|PID)
My installation process
I've been documenting my installation process in a step-by-step guide for further reference. Please take a look to see how I have my new installation set up.