memphisthemau / web-server-notes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

django, WSGI and nginx stack

  • Two distinct components that makes up the web server, so it decouples the application from the web server: uWSGI and nginx.
    • Because web servers cannot talk directly to django. Instead requires a WSGI interface.
    • uWSGI acts as and application server.
    • nginx handles and forwards the HTTP requests.
  • Ease of partinioning between development and production environment.
    • Code development and testing is done using virtual environments using high TCP ports.
    • Production code is run via application servers wtih nginx handling and serving the client HTTP requests.
  • Perl and PHP language support is done via uWSGI plugin implementations.
  • Concept
web client <-> web server <-> tcp socket <-> uwsgi <-> django
  • Running the code in the development environment.
    • Multiple developers will have access to a pool of high-numbered TCP ports.
    • The pool of high-numbered ports are assigned to the developers.
    • Developers run and test their application in virtualenv sandboxes. pip is used to install required libraries into the sandboxed virtual environments without poluting the libraries on the host box.
  • Running the code in the production environment.
    • Only ports 80 and 443 are available.
    • Run in virtual environment?
    • Development to production deployment workflow?
  • Upgrading nginx.
    • Workflow?
    • Rollback or backout procedure?
  • Upgrading django
    • Workflow?
    • Rollback or backout procedure?
  • Upgrading uwsgi.
    • Workflow?
    • Rollback or backout procedure?

About