* [gentoo-user] The SIMPLEST web server to config (this time - just for serving video files) ? @ 2011-11-13 18:21 Mark Knecht 2011-11-13 19:16 ` Pandu Poluan ` (3 more replies) 0 siblings, 4 replies; 11+ messages in thread From: Mark Knecht @ 2011-11-13 18:21 UTC (permalink / raw To: Gentoo User Hi, Pandu asked a similar question a few days ago about serving up files, but mostly for distfiles IIRC. It got me thinking about doing the same sort of thing, but this time to serve up MP4 video files for my Kindle Fire as well as other computers on _only_ my home network. Sort of an in-house Mark's Watch Instantly setup. I've now got a few hundred gigabyte of mp4 files ripped with Grant's suggested app Handbrake. They look good on my desktop playing in xine. When the Kindle Fire arrives I'd like to have a web server running on my private network that Silk (Amazon's KF broswer) could access, possibly presenting nothing but the alphabetical folders that the video files are in, and then if I select one it starts streaming that file. My main issue isn't really the lightest in terms of memory or CPU usage, but rather something that's VERY easy to setup the config so that I don't have to spend much time reading manuals. From browsing around a lot of pages on the web it seems that there are a number of small & light servers (in terms of memory anyway) in portage. Some names: fnord, thttpd, boa, monkeyd & cherokee. Does anyone know if one of those would fit my main need of just being extremely simple to setup and keep running for this one purpose? Thanks in advance, Mark ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] The SIMPLEST web server to config (this time - just for serving video files) ? 2011-11-13 18:21 [gentoo-user] The SIMPLEST web server to config (this time - just for serving video files) ? Mark Knecht @ 2011-11-13 19:16 ` Pandu Poluan 2011-11-13 19:45 ` Mark Knecht 2011-11-13 19:22 ` Mick ` (2 subsequent siblings) 3 siblings, 1 reply; 11+ messages in thread From: Pandu Poluan @ 2011-11-13 19:16 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 1770 bytes --] On Nov 14, 2011 1:25 AM, "Mark Knecht" <markknecht@gmail.com> wrote: > > Hi, > Pandu asked a similar question a few days ago about serving up > files, but mostly for distfiles IIRC. It got me thinking about doing > the same sort of thing, but this time to serve up MP4 video files for > my Kindle Fire as well as other computers on _only_ my home network. > Sort of an in-house Mark's Watch Instantly setup. I've now got a few > hundred gigabyte of mp4 files ripped with Grant's suggested app > Handbrake. They look good on my desktop playing in xine. When the > Kindle Fire arrives I'd like to have a web server running on my > private network that Silk (Amazon's KF broswer) could access, possibly > presenting nothing but the alphabetical folders that the video files > are in, and then if I select one it starts streaming that file. > > My main issue isn't really the lightest in terms of memory or CPU > usage, but rather something that's VERY easy to setup the config so > that I don't have to spend much time reading manuals. > > From browsing around a lot of pages on the web it seems that there > are a number of small & light servers (in terms of memory anyway) in > portage. Some names: fnord, thttpd, boa, monkeyd & cherokee. Does > anyone know if one of those would fit my main need of just being > extremely simple to setup and keep running for this one purpose? > > Thanks in advance, > Mark > Try: python -m SimpleHTTPServer <port number> & (the trailing ampersand detaches the process and makes it run in the background) Or for something that survives a logout, try: nohup python -m SimpleHTTPServer <port number> & Of course, RAM usage will be huge compared to the lightweight HTTP servers, but I can't think of a simpler thing atm. Rgds, [-- Attachment #2: Type: text/html, Size: 2180 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] The SIMPLEST web server to config (this time - just for serving video files) ? 2011-11-13 19:16 ` Pandu Poluan @ 2011-11-13 19:45 ` Mark Knecht 2011-11-13 22:57 ` Mick 2011-11-14 4:37 ` [gentoo-user] " Stroller 0 siblings, 2 replies; 11+ messages in thread From: Mark Knecht @ 2011-11-13 19:45 UTC (permalink / raw To: gentoo-user On Sun, Nov 13, 2011 at 11:16 AM, Pandu Poluan <pandu@poluan.info> wrote: > > On Nov 14, 2011 1:25 AM, "Mark Knecht" <markknecht@gmail.com> wrote: <SNIP> >> From browsing around a lot of pages on the web it seems that there >> are a number of small & light servers (in terms of memory anyway) in >> portage. Some names: fnord, thttpd, boa, monkeyd & cherokee. Does >> anyone know if one of those would fit my main need of just being >> extremely simple to setup and keep running for this one purpose? >> >> Thanks in advance, >> Mark >> > > Try: > > python -m SimpleHTTPServer <port number> & > > (the trailing ampersand detaches the process and makes it run in the > background) > > Or for something that survives a logout, try: > > nohup python -m SimpleHTTPServer <port number> & > > Of course, RAM usage will be huge compared to the lightweight HTTP servers, > but I can't think of a simpler thing atm. > > Rgds, > Wow! That certainly qualifies for the simple part! The trick seemed to be to cd to the video directory before running python, but once I did that I am able to get video. One 'problem' if you will is the video isn't streaming but rather the whole file is being copied and then xine is being run. That leads to no disk space over time. Is this a function of Firefox being set up to use xine as opposed to some other app or plugin? I'd really like to understand a little more about getting it to stream instead of copy, if possible. The other thing I just tested was accessing the server using my wife's iPod Touch. It can browse to the video files but then Quicktime doesn't play them. Back in the python terminal I see a lot of message like this: ---------------------------------------- 192.168.1.243 - - [13/Nov/2011 11:44:26] "GET /H/Howard%27s%20End.m4v HTTP/1.1" 200 - ---------------------------------------- Exception happened during processing of request from ('192.168.1.243', 49450) Traceback (most recent call last): File "/usr/lib64/python2.7/SocketServer.py", line 284, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib64/python2.7/SocketServer.py", line 310, in process_request self.finish_request(request, client_address) File "/usr/lib64/python2.7/SocketServer.py", line 323, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/lib64/python2.7/SocketServer.py", line 641, in __init__ self.finish() File "/usr/lib64/python2.7/SocketServer.py", line 694, in finish self.wfile.flush() File "/usr/lib64/python2.7/socket.py", line 303, in flush self._sock.sendall(view[write_offset:write_offset+buffer_size]) error: [Errno 32] Broken pipe ---------------------------------------- None the less it's an interesting start. Thanks!! Cheers, Mark ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] The SIMPLEST web server to config (this time - just for serving video files) ? 2011-11-13 19:45 ` Mark Knecht @ 2011-11-13 22:57 ` Mick 2011-11-14 0:20 ` Pandu Poluan 2011-11-15 19:57 ` [gentoo-user] " Steven J Long 2011-11-14 4:37 ` [gentoo-user] " Stroller 1 sibling, 2 replies; 11+ messages in thread From: Mick @ 2011-11-13 22:57 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: Text/Plain, Size: 2774 bytes --] On Sunday 13 Nov 2011 19:45:38 Mark Knecht wrote: > Wow! That certainly qualifies for the simple part! The trick seemed to > be to cd to the video directory before running python, but once I did > that I am able to get video. > > One 'problem' if you will is the video isn't streaming but rather the > whole file is being copied and then xine is being run. That leads to > no disk space over time. It is not streaming, because you are not running a streaming server and in all likelihood the video file is not in 'streaming' media format. Therefore when you click on the link the ipod downloads a complete file. > Is this a function of Firefox being set up to use xine as opposed to > some other app or plugin? I'd really like to understand a little more > about getting it to stream instead of copy, if possible. You can have a true streaming server (MMS, RTP, RTSP) or you can have a webserver (HTTP) which serves streaming media format files. Have you tried setting up vlc as a streaming server on your PC? It will also transcode files into streaming media. Alternatively, use a device with a large enough storage on it to be able to save the whole of the downloaded file. > The other thing I just tested was accessing the server using my wife's > iPod Touch. It can browse to the video files but then Quicktime > doesn't play them. Back in the python terminal I see a lot of message > like this: > > ---------------------------------------- > 192.168.1.243 - - [13/Nov/2011 11:44:26] "GET /H/Howard%27s%20End.m4v > HTTP/1.1" 200 - > ---------------------------------------- > Exception happened during processing of request from ('192.168.1.243', > 49450) Traceback (most recent call last): > File "/usr/lib64/python2.7/SocketServer.py", line 284, in > _handle_request_noblock > self.process_request(request, client_address) > File "/usr/lib64/python2.7/SocketServer.py", line 310, in process_request > self.finish_request(request, client_address) > File "/usr/lib64/python2.7/SocketServer.py", line 323, in finish_request > self.RequestHandlerClass(request, client_address, self) > File "/usr/lib64/python2.7/SocketServer.py", line 641, in __init__ > self.finish() > File "/usr/lib64/python2.7/SocketServer.py", line 694, in finish > self.wfile.flush() > File "/usr/lib64/python2.7/socket.py", line 303, in flush > self._sock.sendall(view[write_offset:write_offset+buffer_size]) > error: [Errno 32] Broken pipe > ---------------------------------------- > > None the less it's an interesting start. Thanks!! I'm pretty much clueless in python so can't interpret the messages - hopefully someone more knowledgeable will chime in. -- Regards, Mick [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] The SIMPLEST web server to config (this time - just for serving video files) ? 2011-11-13 22:57 ` Mick @ 2011-11-14 0:20 ` Pandu Poluan 2011-11-15 19:57 ` [gentoo-user] " Steven J Long 1 sibling, 0 replies; 11+ messages in thread From: Pandu Poluan @ 2011-11-14 0:20 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 2368 bytes --] On Nov 14, 2011 6:01 AM, "Mick" <michaelkintzios@gmail.com> wrote: > > On Sunday 13 Nov 2011 19:45:38 Mark Knecht wrote: > > > Wow! That certainly qualifies for the simple part! The trick seemed to > > be to cd to the video directory before running python, but once I did > > that I am able to get video. > > > > One 'problem' if you will is the video isn't streaming but rather the > > whole file is being copied and then xine is being run. That leads to > > no disk space over time. > > It is not streaming, because you are not running a streaming server and in all > likelihood the video file is not in 'streaming' media format. Therefore when > you click on the link the ipod downloads a complete file. > Actually, if the server supports the byte-range option (i.e., ability to do random access 'seek') AND the server returns the proper Content-Type header, then the server can stream. > > Is this a function of Firefox being set up to use xine as opposed to > > some other app or plugin? I'd really like to understand a little more > > about getting it to stream instead of copy, if possible. > > You can have a true streaming server (MMS, RTP, RTSP) or you can have a > webserver (HTTP) which serves streaming media format files. > > Have you tried setting up vlc as a streaming server on your PC? It will also > transcode files into streaming media. > That will make the server neither light nor simple, though :-) > Alternatively, use a device with a large enough storage on it to be able to > save the whole of the downloaded file. > > > > The other thing I just tested was accessing the server using my wife's > > iPod Touch. It can browse to the video files but then Quicktime > > doesn't play them. Back in the python terminal I see a lot of message > > like this: > > > > ---------------------------------------- > > 192.168.1.243 - - [13/Nov/2011 11:44:26] "GET /H/Howard%27s%20End.m4v > > HTTP/1.1" 200 - > > ---------------------------------------- > > Exception happened during processing of request from ('192.168.1.243', > > 49450) Traceback (most recent call last): ----- >8 snip ----- > > > > None the less it's an interesting start. Thanks!! > > I'm pretty much clueless in python so can't interpret the messages - hopefully > someone more knowledgeable will chime in. > Neither am I, but it seems SimpleHTTPServer is too simple. Rgds, [-- Attachment #2: Type: text/html, Size: 3005 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* [gentoo-user] Re: The SIMPLEST web server to config (this time - just for serving video files) ? 2011-11-13 22:57 ` Mick 2011-11-14 0:20 ` Pandu Poluan @ 2011-11-15 19:57 ` Steven J Long 1 sibling, 0 replies; 11+ messages in thread From: Steven J Long @ 2011-11-15 19:57 UTC (permalink / raw To: gentoo-user Mick wrote: >> File "/usr/lib64/python2.7/SocketServer.py", line 694, in finish >> self.wfile.flush() >> File "/usr/lib64/python2.7/socket.py", line 303, in flush >> self._sock.sendall(view[write_offset:write_offset+buffer_size]) >> error: [Errno 32] Broken pipe >> ---------------------------------------- >> > I'm pretty much clueless in python so can't interpret the messages - > hopefully someone more knowledgeable will chime in. > 'Broken pipe' just means the remote closed the connection. It's a pretty standard error in this context, which the server should handle. A process normally gets a SIGPIPE which will by default terminate it, which is what you want if you have a pipeline'd command whose output is no longer required. An example would be checking there is at least one matching file somewhere in a directory hierarchy with: read -d '' f < <(find /base/dir -type f -name 'foo*' -print0) [[ $f ]] || echo 'no foo* files' -- find will terminate after the first filename has been read. In this case, signal(SIGPIPE, SIG_IGN) or the equivalent has been called, which gives EPIPE instead; a process ignoring the signal is supposed to deal with the error. So I'd say it's a bug. -- #friendly-coders -- We're friendly, but we're not /that/ friendly ;-) ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] The SIMPLEST web server to config (this time - just for serving video files) ? 2011-11-13 19:45 ` Mark Knecht 2011-11-13 22:57 ` Mick @ 2011-11-14 4:37 ` Stroller 1 sibling, 0 replies; 11+ messages in thread From: Stroller @ 2011-11-14 4:37 UTC (permalink / raw To: gentoo-user On 13 November 2011, at 19:45, Mark Knecht wrote: > ... > One 'problem' if you will is the video isn't streaming but rather the > whole file is being copied and then xine is being run. That leads to > no disk space over time. See if you can run Samba client on this device (and Samba on the server, too). Stroller. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] The SIMPLEST web server to config (this time - just for serving video files) ? 2011-11-13 18:21 [gentoo-user] The SIMPLEST web server to config (this time - just for serving video files) ? Mark Knecht 2011-11-13 19:16 ` Pandu Poluan @ 2011-11-13 19:22 ` Mick 2011-11-13 20:08 ` Mark Knecht 2011-11-13 19:28 ` Chris Brennan 2011-11-14 14:57 ` [gentoo-user] " Grant Edwards 3 siblings, 1 reply; 11+ messages in thread From: Mick @ 2011-11-13 19:22 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: Text/Plain, Size: 2305 bytes --] On Sunday 13 Nov 2011 18:21:17 Mark Knecht wrote: > Hi, > Pandu asked a similar question a few days ago about serving up > files, but mostly for distfiles IIRC. It got me thinking about doing > the same sort of thing, but this time to serve up MP4 video files for > my Kindle Fire as well as other computers on _only_ my home network. > Sort of an in-house Mark's Watch Instantly setup. I've now got a few > hundred gigabyte of mp4 files ripped with Grant's suggested app > Handbrake. They look good on my desktop playing in xine. When the > Kindle Fire arrives I'd like to have a web server running on my > private network that Silk (Amazon's KF broswer) could access, possibly > presenting nothing but the alphabetical folders that the video files > are in, and then if I select one it starts streaming that file. > > My main issue isn't really the lightest in terms of memory or CPU > usage, but rather something that's VERY easy to setup the config so > that I don't have to spend much time reading manuals. > > From browsing around a lot of pages on the web it seems that there > are a number of small & light servers (in terms of memory anyway) in > portage. Some names: fnord, thttpd, boa, monkeyd & cherokee. Does > anyone know if one of those would fit my main need of just being > extremely simple to setup and keep running for this one purpose? > > Thanks in advance, > Mark Both thttpd and boa that I am using are extremely simple to configure - just a few lines in their config files and your iptables rules to allow access from your LAN, or from a particular IP address. Apache is also not *too* complicated, although it is more work for sure and much more demanding on resources. Certainly an overkill for your needs. lighttpd is another feature rich alternative, not as small footprint, but in some tests marginally faster than thttpd. monkeyd also quite fast. If your priorities are low demand on resources on the host PC and a high response/throughput speed for single threads, then I'd say give boa a spin. If you will be connecting in parallel with multiple clients check lighttpd, or thttpd. If you are keen on exotica consider nginx, or G-WAN, but their configuration may be more involved. -- Regards, Mick [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] The SIMPLEST web server to config (this time - just for serving video files) ? 2011-11-13 19:22 ` Mick @ 2011-11-13 20:08 ` Mark Knecht 0 siblings, 0 replies; 11+ messages in thread From: Mark Knecht @ 2011-11-13 20:08 UTC (permalink / raw To: gentoo-user On Sun, Nov 13, 2011 at 11:22 AM, Mick <michaelkintzios@gmail.com> wrote: <SNIP> > > Both thttpd and boa that I am using are extremely simple to configure - just a > few lines in their config files and your iptables rules to allow access from > your LAN, or from a particular IP address. Apache is also not *too* > complicated, although it is more work for sure and much more demanding on > resources. Certainly an overkill for your needs. > > lighttpd is another feature rich alternative, not as small footprint, but in > some tests marginally faster than thttpd. monkeyd also quite fast. > > If your priorities are low demand on resources on the host PC and a high > response/throughput speed for single threads, then I'd say give boa a spin. > If you will be connecting in parallel with multiple clients check lighttpd, or > thttpd. > > If you are keen on exotica consider nginx, or G-WAN, but their configuration > may be more involved. > -- > Regards, > Mick > OK, thttpd seems like what I was looking for. One line in /etc/conf.d/thttpd to point at the video directory and it has an init file so I can start it with rc-update. It works fine, at least in the sense that I can play the files on other computers if not the iPod. It's interesting that in the case of the iPod with python as the server it just showed some broken link icon. However with thttpd it actually said the iPod couldn't play it because the file was too large. I happen to know that the iPod right now doesn't have enough disk space to store a 1GB movie so maybe that's all it's complaining about. I'll get my wife to clean up the device if she's interested in using this. For now though I'd guess this solution might work with the Kindle Fire which was my main goal before the device arrives. It's really only the stream vs copy question that would make this a really complete solution for me. Cheers, Mark ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] The SIMPLEST web server to config (this time - just for serving video files) ? 2011-11-13 18:21 [gentoo-user] The SIMPLEST web server to config (this time - just for serving video files) ? Mark Knecht 2011-11-13 19:16 ` Pandu Poluan 2011-11-13 19:22 ` Mick @ 2011-11-13 19:28 ` Chris Brennan 2011-11-14 14:57 ` [gentoo-user] " Grant Edwards 3 siblings, 0 replies; 11+ messages in thread From: Chris Brennan @ 2011-11-13 19:28 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 1883 bytes --] On Sun, Nov 13, 2011 at 1:21 PM, Mark Knecht <markknecht@gmail.com> wrote: Hi, > Pandu asked a similar question a few days ago about serving up > files, but mostly for distfiles IIRC. It got me thinking about doing > the same sort of thing, but this time to serve up MP4 video files for > my Kindle Fire as well as other computers on _only_ my home network. > Sort of an in-house Mark's Watch Instantly setup. I've now got a few > hundred gigabyte of mp4 files ripped with Grant's suggested app > Handbrake. They look good on my desktop playing in xine. When the > Kindle Fire arrives I'd like to have a web server running on my > private network that Silk (Amazon's KF broswer) could access, possibly > presenting nothing but the alphabetical folders that the video files > are in, and then if I select one it starts streaming that file. > > My main issue isn't really the lightest in terms of memory or CPU > usage, but rather something that's VERY easy to setup the config so > that I don't have to spend much time reading manuals. > > From browsing around a lot of pages on the web it seems that there > are a number of small & light servers (in terms of memory anyway) in > portage. Some names: fnord, thttpd, boa, monkeyd & cherokee. Does > anyone know if one of those would fit my main need of just being > extremely simple to setup and keep running for this one purpose? > > Thanks in advance, > Mark > > nginx comes to mind, very easy to set up and it should be able to serve your video's w/o issue... > -- > Chris Brennan > A: Yes. > >Q: Are you sure? > >>A: Because it reverses the logical flow of conversation. > >>>Q: Why is top posting frowned upon? > http://xkcd.com/84/ | http://xkcd.com/149/ | http://xkcd.com/549/ > GPG: D5B20C0C (6741 8EE4 6C7D 11FB 8DA8 9E4A EECD 9A84 D5B2 0C0C) ------------------------------------------------------------------------ [-- Attachment #2: Type: text/html, Size: 2808 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* [gentoo-user] Re: The SIMPLEST web server to config (this time - just for serving video files) ? 2011-11-13 18:21 [gentoo-user] The SIMPLEST web server to config (this time - just for serving video files) ? Mark Knecht ` (2 preceding siblings ...) 2011-11-13 19:28 ` Chris Brennan @ 2011-11-14 14:57 ` Grant Edwards 3 siblings, 0 replies; 11+ messages in thread From: Grant Edwards @ 2011-11-14 14:57 UTC (permalink / raw To: gentoo-user On 2011-11-13, Mark Knecht <markknecht@gmail.com> wrote: > My main issue isn't really the lightest in terms of memory or CPU > usage, but rather something that's VERY easy to setup the config so > that I don't have to spend much time reading manuals. Busybox httpd: Just start it in the directory from which you want to serve files. -- Grant Edwards grant.b.edwards Yow! If I felt any more at SOPHISTICATED I would DIE gmail.com of EMBARRASSMENT! ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2011-11-15 19:54 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-11-13 18:21 [gentoo-user] The SIMPLEST web server to config (this time - just for serving video files) ? Mark Knecht 2011-11-13 19:16 ` Pandu Poluan 2011-11-13 19:45 ` Mark Knecht 2011-11-13 22:57 ` Mick 2011-11-14 0:20 ` Pandu Poluan 2011-11-15 19:57 ` [gentoo-user] " Steven J Long 2011-11-14 4:37 ` [gentoo-user] " Stroller 2011-11-13 19:22 ` Mick 2011-11-13 20:08 ` Mark Knecht 2011-11-13 19:28 ` Chris Brennan 2011-11-14 14:57 ` [gentoo-user] " Grant Edwards
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox