9

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.

4 Answers4

15

Use thttpd.

thttpd -d /home/bob/sharedfolder -p 8080

The directory /home/bob/sharedfolder would become accessible at http://address:8080.

screenshot of thttpd directory listing in Chrome showing localhost on port 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
grawity
  • 501,077
4

I recently created a python module, ext_http_server, that extends the functionality of the SimpleHTTPServermodule. 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.

bboe
  • 141
  • 3
2

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! ;)

grawity
  • 501,077
adeelx
  • 1,288
0

I am surprised that no one mentions nodejs http-server. You can install it using the following command

npm install -g http-server

then hosting a HTTP file server becomes a one-liner:

http-server -p 3000 /path/to/folder

The directory /path/to/folder would become accessible at http://address:3000.

This allows resumable download file (e.g. using wget -c), while python -m http.server 3000 does not.