4 ms·
Good advice for problems, but one should focus more on the underlying problem mentioned: chances are, vital files can be accessed with the rights your applicat
by davidhollander 16y ago
Good advice for problems, but one should focus more on the underlying problem mentioned:
chances are, vital files can be accessed with the rights your application has.
When you deploy your webapp, NEVER run your web server or application container server as root. I deploy python using nginx and uWSGI where nginx runs as the "nginx" user and group, and uwsgi runs as the "uwsgi" user and group.
Since uWSGI is spawning all the python instances, if I want to be able access files on disk such as for storing and reading sessions, I must explicitly change the folder owner to the uwsgi group for the webapp to even launch.
If you take only one security precaution for your production python app, make sure none of the instantiating servers run as root and that they must be given explicit permission to access folders.