mkdir -p /tmp/testsite echo "hello from server $(date)" > /tmp/testsite/index.html cd /tmp/testsite nohup python3 -m http.server 80 --bind 0.0.0.0 > /tmp/http.log 2>&1 &
Non-superuser may not have access to 80 port, use sudo then.
To kill the thread, get its pid via
ps aux | grep "python3 -m http.server" | grep -v grep
and then terminate the task using
kill <pid>
or
kill -9 <pid>