Start SimpleHTTPServer as a Windows Service with AlwaysUp

How to Start Python's SimpleHTTPServer in the Background as a Windows Service

Automatically run SimpleHTTPServer when your machine boots; serve your files 24x7 without having to log in

Python's SimpleHTTPServer provides a quick and easy way to serve a folder, without needing to install and configure a full blown web server.

To set up SimpleHTTPServer to run as a Windows Service with AlwaysUp:

  1. Download and install AlwaysUp, if necessary.

  2. Download and install Python 2, which includes SimpleHTTPServer, if necessary.

  3. Start AlwaysUp.

  4. Select Application > Add to open the Add Application window:

    Add Application

  5. On the General tab:

    • In the Application field, enter the full path to the python executable, python.exe. Since we installed Python in C:\Python2.7, we'll specify this value for this tutorial:

      C:\Python27\python.exe

    • In the Arguments field, enter the full path to the SimpleHTTPServer.py script in the Python Lib folder. You can also add the port number at the end if you want to change it from the default of 8000.

      For our installation, we'll specify:

      -m C:\Python27\Lib\SimpleHTTPServer.py

      Be sure to enclose the path to the SimpleHTTPServer script if it contains a space!

    • In the Start in directory field, enter the folder you would like to serve with SimpleHTTPServer. We're sharing our Music folder.

    • And in the Name field, enter the name that you will call this application in AlwaysUp. When you click into the field, the default will be set to "Python", but we recommend changing it to something more meaningful (like SimpleHTTPServer).

    SimpleHTTPServer Windows Service: General Tab

  6. Click over to the Logon tab and enter the user name and password of the Windows account in which you installed and configured Python.

    SimpleHTTPServer Windows Service: Logon Tab

  7. Click over to the Startup tab and check the Ensure that the Windows Networking components have started box. This informs AlwaysUp that SimpleHTTPServer needs the regular TCP/IP networking stack to operate. We don't want python to start too soon!

    SimpleHTTPServer Windows Service: Startup Tab

  8. When SimpleHTTPServer is running as a windows service, it will only be visible in the isolated Session 0. You can switch to Session 0 to see it, but another option is to save SimpleHTTPServer's output to a file. To set this up, switch to the Extras tab and enter the full path to your log file in the Capture output to this log file section. We recommend choosing to automatically trim the file to prevent it growing out of hand.

    SimpleHTTPServer Windows Service: Extras Tab

  9. We're now done configuring AlwaysUp, so click the Save button. In a couple of seconds, an application called SimpleHTTPServer (or whatever you called it) will show up in the AlwaysUp window. It is not yet running though and the state will be Stopped.

    SimpleHTTPServer Windows Service: Created

  10. To start SimpleHTTPServer, choose Application > Start "SimpleHTTPServer". The state should transition to Running after a few seconds and SimpleHTTPServer should be serving the folder you specified in step 5.

    SimpleHTTPServer Windows Service: Running

  11. That's it! Next time your computer boots, your SimpleHTTPServer service will be launched immediately, before anyone logs on. Feel free to edit the entry in AlwaysUp and add more advanced options. For example, boost the priority of the python process, send an email if the server fails, and much more.



SimpleHTTPServer script not working properly as a Windows Service?

  • Visit the AlwaysUp Troubleshooter - our online tool that can help you resolve the most common problems encountered when running an application as a windows service.
  • From AlwaysUp, select Application > Report Activity > Today... to bring up a HTML report detailing the interaction between AlwaysUp and your application. The AlwaysUp Event Log Messages page explains the more obscure messages.
  • Consult the AlwaysUp FAQ for answers to commonly asked questions and troubleshooting tips.
  • Contact us and we will be happy to help!

Download & Try it Free!

Download AlwaysUp and Run as a Service Today! Version 15.5 New!

8.0 MB Installer
Our 12,000+ customers include...
Compatible with Windows 11 Compatible with Windows Server 2022 Compatible with Windows 10
Over 94,000 installations, and counting!
 
AlwaysUp is number 1! Run as a Service with AlwaysUp

Rock-solid for the past 19+ years!