-1

I have root and deployer users in my ubuntu 13.10. I also have nginx, unicorn installed with Rails 4 application. I'm deploying my application using capistrano 3.

Problem: When I prepare a env for Rails. I'm installed nginx using root user. But after my deployment is complete, my deployer can't restart nginx server. Because it's started by root user. And also deployer can't access to write .pid file.

What should I do? Uninstall nginx and re-install with deployer user?

Thank you for advice. Sorry for poor English.

Zeck
  • 101
  • 2

2 Answers2

1

Don't run nginx as the root user, you should be using a www-data user or even your deployer user. This can be changed in the /etc/nginx/nginx.conf file (should be the first line). Then restart nginx using service or your init.d script.

Alex Turner
  • 313
  • 3
  • 10
0

You can give sudo rights to deployer user to reload nginx. See /etc/sudoers and its man page for closer details.

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58