When I deploy with Capistrano 3 I deploy to /home/dev/app-name/
. Cap creates a directory structure /home/dev/app-name/current/
which is a symlink to /home/dev/app-name/releases/20181129161818
(the current release).
This symlink is broken and does not work for nginx and passenger. I know this because this is my app config located in /etc/nginx/conf.d/app-name.conf
:
server {
listen 80;
server_name app-name.domain.com;
passenger_enabled on;
passenger_ruby /home/dev/.rvm/gems/ruby-2.5.1/wrappers/ruby;
rails_env production;
root /home/dev/app/app-name/releases/20181129161818/public/;
#root /home/dev/app/app-name/current/public;
}
if I comment out the path root /home/dev/app/mullen-admin/releases/20181129161818/public/;
and sudo service nginx restart
the app works.
If I use the other root directive, the app is broken and I get this 500 Server Error.
2018/11/29 15:31:43 [alert] 11278#0: *3 Cannot stat '/home/dev/app/app-name/current/passenger_wsgi.py':
Permission denied (errno=13); This error means that the Nginx worker process (PID 11278, running as UID 1002) does not have permission to access this file.
Please read this page to learn how to fix this problem: https://www.phusionpassenger.com/library/admin/nginx/troubleshooting/?a=upon-accessing-the-web-app-nginx-reports-a-permission-denied-error;
Extra info, client: 10.194.234.100, server: app-name.domain.com, request: "GET /employees/sign_in HTTP/1.1", host: "app-name.domain.com"
I am running centos-release-7-5.1804.5.el7.centos.x86_64
on a virtual machine at the office I work at. I have a sudouser dev
that I use to ssh and deploy with.
Please help!? I need the app to work at /current in the nginx root directive so I can deploy and have changes take effect.