Skip to content

Instantly share code, notes, and snippets.

@mneil
Last active May 8, 2017 20:30
Show Gist options
  • Save mneil/fbc7845fe61eed09c39364f7d12eb4b8 to your computer and use it in GitHub Desktop.
Save mneil/fbc7845fe61eed09c39364f7d12eb4b8 to your computer and use it in GitHub Desktop.
Upstart Twistd Server
# UPSTART SCRIPT
# /etc/init/{taskname}.conf
# This task is run on startup to run miniweb which is a tiny static server
description "Run the miniweb web form"
start on (filesystem and net-device-up IFACE!=lo)
task
exec sudo twistd -no web --path /path/to/web/dir --port="tcp:8000"
respawn limit 20 90
@mneil
Copy link
Author

mneil commented May 5, 2017

With SSL

twistd -no web --path /path/to/web/dir --port 7000 --https 7001 -c /path/to/web/dir/mycert.pem -k /path/to/web/dir/mycert.pem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment