Inetd HTTP server

From VVCWiki
Revision as of 19:02, 5 November 2010 by Vvc (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

In case you need a place holder or redirector for http server it's easy to implement using the following:

Add to /etc/inetd.conf (or similar)

http    stream  tcp     nowait  nobody  /usr/local/bin/tiny_httpd

Now create the /usr/local/bin/tiny_httpd:

#!/usr/bin/tail -n+2
HTTP/1.1 200 OK
Server: Tail_Server/1.0 (Unix)
Last-Modified:  Sat, 15 Dec 2007 20:00:00 GMT
Connection: close
Content-Type: text/html

<HTML>
 ....
whatever message is required
....
</HTML>