Skip to content

Instantly share code, notes, and snippets.

@saagarjha
Created October 6, 2019 03:38
Show Gist options
  • Save saagarjha/1b4a65580dfc69a4ef14cb7afec5e5c8 to your computer and use it in GitHub Desktop.
Save saagarjha/1b4a65580dfc69a4ef14cb7afec5e5c8 to your computer and use it in GitHub Desktop.
systemd service to run a webserver
[Unit]
Description=Python Web Server
After=network.target
[Service]
Type=simple
Restart=always
User=root
WorkingDirectory=/share
ExecStart=/usr/bin/python3 -m http.server 80
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment