linux - File permissions for Django: Gunicorn, Nginx, and Static Files -
I have a standard Ubuntu 14.04 machine. I use it daily under user Nginx is currently configured to run under Next: I am storing all my web development files under To make this case complicated, virtualenvwrapper creates my virtual environment under I have two scoops best practices and store Thank you. All our files and directories output environment with 755/644 file permissions For project structure: All our projects have a dedicated directory under Many of our main project directories (manage.py and many deployment / update scripts) are included in the forward division outside subdirectores and it is: ie Runs our NGN process as mh00h . I'm interested in using this machine as a production server. How can I manage file permissions for Django and Nginx?
www-data: www-data . This reduces the risk of the rest of a machine. Django / gunicorn should be similarly run under a user other than
mh00h . But what under the user can actually run Gunocorn?
Any , right?
/ home / mh00h / development . Owned by
mh00h
/ home / mh00h / development / project1 (all directories / files but / media and / static) ? Owned by
mh00h I do the best practice of the two-pick of the Django to create a project directory with stable files inside it. Of course, now NGX will now have
/ home / mh00h / development / project1 / project1 / Static because all of those root directories are
mh00h , not
Www-data (
. / Static Is owned by
www-data ).
/home/mh00h/.virtualenvs/ .
/ static separate
/ var / www , because I have all these directories well on any other server But later I want to be packed together for easy transportation.
root: root < / Code>, unless otherwise necessary. Some private files (private keys, etc.) are read only by the user / process, while they are still descriptive by the
root .
/srv/www/vhosts.d/ . Virtual environments are submitted under
/ srv / www / virtualenvs . It is entirely possible to store them in your home folder, but I think this central approach is more with the idea of the server to produce the right settings, all virtual envs are also available by all users.
the web are public files,
Src
frontend contains the source folder included in the template folder and the saab folder. The entire project directory is included in the GIT repository, but deployment-specific files (user uploaded files, search index, encryption key) are all in the
.git-ignore .
www-data . Normally each Django project has its own user, and the gunicorn process runs as user.
Comments
Post a Comment