Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
"share a ... file" - So... you want to transfer a file eh, and you don't want to use the FILE TRANSFER PROTOCOL why? –  ta.speot.is Jul 7 '11 at 8:10
2  
I don't find name-ism useful here, there is nothing wrong with wanting to use a browser to download a file especially since the end user is comfortable with it. Don't see what should be complex or problemabtic about running a resumable HTTP server, do you? –  Luke Stanley Jul 7 '11 at 8:13
    
I have a partial answer I may post in ~6 hours (rep < 100): pastebin.com/DS0wedwk –  Luke Stanley Jul 7 '11 at 9:36
    
@todda.speot.is: maybe because FTP is insecure and sends password across the network. –  MaxMackie Jul 7 '11 at 13:08
1  
Mainly it's because simplicity for end users is king. –  Luke Stanley Jul 7 '11 at 21:07
show 6 more comments

3 Answers

up vote 5 down vote accepted

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
share|improve this answer
    
Thanks grawity, I made some edits. Would appreciate some question upvotes. –  Luke Stanley Jul 7 '11 at 21:22
    
even python -m SimpleHTTPServer 8000 should be enough ... :) –  akira Jan 23 '12 at 18:19
    
@akira: SimpleHTTPServer does not support byte ranges, meaning it cannot resume interrupted transfers. Test with curl http://localhost:8000/testfile -o /dev/null -C 100, for example. –  grawity Jan 23 '12 at 18:21
    
This is exactly what I needed, using lighttpd now and it's working great. –  Rob Jan 23 '12 at 18:38
    
@grawity: true. but that aside: might be a viable option. missing byte range: thats why i only put it aside your answer and not as a standalone answer. –  akira Jan 24 '12 at 7:00
add comment

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

share|improve this answer
    
Yeah I used Monkey already. Arbitrary difference perhaps. See: pastebin.com/DS0wedwk but I'm looking for a 0 config file solution if possible :) –  Luke Stanley Jul 7 '11 at 9:35
add comment

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.

share|improve this answer
    
that sounds cool! –  Luke Stanley Aug 29 '12 at 4:55
    
I actually used this for something but I didn't want rate limiting, https or user/pass, so it's a bit verbose to command for what I wanted: ext_http_server --cert /home/luke/Downloads/cert.pem -d . -p 9191 -a test:test -r 999999999999999 –  Luke Stanley Oct 23 '12 at 7:56
    
The default executable in the package that is created is meant to have all of those features. With a little work you could build your own executable (script) that has only the resumable downloads. However, in that case, it'll probably be faster to use thttpd or lighttpd. –  bboe Oct 23 '12 at 18:38
    
Yeah, it might be worth considering a simple mode, or as a simple mode as a default. Nice work though, of course. –  Luke Stanley Oct 23 '12 at 22:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.