Bare bones HTTP server for linux with resumable file downloads
I have a Windows user I want to share a large file with, they have Firefox with I understand supports resumable HTTP file downloads, and I have Ubuntu Linux, but limited disk space and such, so I don't want a full blown solution like Apache's web server.
I'd like to just run the server via the command line or GUI when I want, not on boot.
If I can avoid it, I don't want to edit a config file - I'd rather just give a command line argument for it's port, I'm used to using python -m SimpleHTTPServer - but I don't think it is resumable.
Solution 1:
Use thttpd.
thttpd -d /home/bob/sharedfolder -p 8080
The directory /home/bob/sharedfolder
would become accessible at http://address:8080
.
lighttpd can be used in a similar way, although it needs a tiny config file. For example:
server.document-root = "/home/bob/sharedfolder"
server.port = 8080
dir-listing.activate = "enable"
which is then ran like this:
lighttpd -f foo.conf
Solution 2:
I recently created a python module, ext_http_server
, that extends the functionality of the SimpleHTTPServer
module. One of its features is resumable file downloads, in addition to https, authentication and rate limiting.
Here's a direct link to the installation and usage instructions.
I should state that lighttpd contains all the same functionality so if you're looking for something production-ready go with lighttpd. If you're looking for using something in python that you can easily build-upon, check out ext_http_server
.
Solution 3:
Use Lighttpd - You're using Linux so I guess you're familiar with the drill! Place the file you want to share in the /var/www folder Modify the init.d conf file to remove Lighttpd from bootup daemons.
Lighttpd does all you want and more - And, its not small, its TINY! ;)