Use built-in HTTP server

Python comes with a http server module, allowing to host web applications or a sphinx documentation for development purposes.

To keep it running, move it to a separate screen session named http_server:

$ screen -S http_server

Inside the new screen start the HTTP server via

$ python -m http.server --bind 127.0.0.1 --directory ~/my_sphinx_doc/build 31500
  • The --bind option sets the URL to localhost

  • The --directory option must point to the web application (usually where the index.html file resides)

  • The 31500 defines the port and should be a number between 1024 (numbers from 0 to 1023 are reserved for system services) and 65535 (as long as no other service already uses that port)

To switch back to the original window, type Ctrl+A followed by a simple d (for detach). See screen reference for more info.