[Dnsmasq-discuss] [suggestion] tiny embedded web server
Simon Kelley
simon at thekelleys.org.uk
Thu Jan 27 11:32:01 GMT 2011
Cristian Măgherușan-Stanciu wrote:
> Hello,
>
> I had this idea while trying to consolidate my PXE net-install machine
> using dnsmasq instead of ISC-DHCPD, TFTPD, and BIND, which I used before.
>
> I still had to run a web server (yeah, I know there are plenty of small
> ones), so for such use cases it would be great if dnsmasq had a small
> web server embedded that would be able to serve static content from a
> directory if configured to do so, similar to the TFTP server that is
> already in.
>
> What do you guys think about this?
>
Dnsmasq currently provides DNS, DHCP, PXE and TFTP. The advantage of
combining DNS and DHCP is, I hope, obvious. PXE is an extension of the
DHCP protocol and adds a lot of functionality for very little extra
code. TFTP is possibly a bit more difficult to justify: there's no
actual interaction between the TFTP server and the rest of dnsmasq, but
for most people, a limited TFTP server needed for net-booting, so
providing just the facilities needed for net-boot saves a bigger, more
general server. In addition, a TFTP server is a UDP server, so quite a
lot of duplicate code can be saved in the general infrastructure and UDP
networking areas.
An HTTP server seems to be another step down this road, probably a step
too far. There's probably not much more that can be stripped out of a
small HTTP server, that's just used for net-boot, gPXE style. An HTTP
server is doing TCP, so it won't share much infrastructure code with the
rest of dnsmasq and doesn't fit well with the
one-process-for-nearly-everything model that dnsmasq uses.
Using a stand-alone small server seems to be the way to go. For the most
common resource-challenged platform, WRT-style routers, there is one
there already, as they are configured using a web brower.
HTH
Simon.
More information about the Dnsmasq-discuss
mailing list