Linux schema for Django production server

I'm currently trying to configure the nginx + uWSGI server for my Django homepage. Some tutorials advise me to create specific UNIX users for specific demons. As a nginx user for the nginx daemon, etc. Since I'm new to Linux administration, I just decided to create a second user to run all the processes (nginx, uWSGI, etc.), but it turned out that I needed --system users for this.

The main question: what users would you configure for the nginx + uWSGI server and how to work with them? Let's say I have a server with the recently installed Debian Squeeze.

Should I install all the packages, the virtual environment and configure all the directories as root, and then create system directories to run the scripts?

+6
source share
1 answer

I like to have regular users on the system:

  • several admins appear in sudo magazines - there is nothing like asking a specific person why they made certain changes.

  • not all tasks require administrator rights, but errors at the administrator level can be more expensive to recover

  • it’s easier to manage ~/.ssh/authorized_keys , if each file contains only the keys to a specific user - if you get four or five different users in it, it’s more difficult to manage. Little point :), but writing is so easy to write cat ~/.ssh/id_rsa.pub | ssh user@remotehost "cat - > ~/.ssh/authorized_keys" cat ~/.ssh/id_rsa.pub | ssh user@remotehost "cat - > ~/.ssh/authorized_keys" - if you need to use >> instead, it is unstable. :)

But you're right, you can do all of your work as root and not worry about regular user accounts.

+2
source

Source: https://habr.com/ru/post/887985/


All Articles