Re: catch all server

richard lucassen <[email protected]> Tue, 22 Jan 2008 21:24:56 +0100
Newsgroups gmane.comp.djb.publicfile
Organization XAQ Systems
Message-ID <[email protected]>
On Tue, 22 Jan 2008 11:25:18 +0100
richard lucassen <[email protected]> wrote:

> Is it possible to generate a catch all page for publicfile? I mean a
> page independent of the host headers.

$ cat run

#!/bin/sh
exec /usr/local/bin/envuidgid qftp /usr/local/bin/tcpserver -DRHl0 \
-b40 -c100 127.0.0.1 80 /usr/local/sbin/block-http/generate-page

$ cat generate-page

#!/bin/sh
exec 2>/dev/null
echo -e "GET http://blocked/index.html HTTP/1.1\nHost:
localhost\nUser-Agent: Links\nAccept: */*\nAccept-Charset: us-ascii,
ISO-8859-1, ISO-8859-15, utf-8\nConnection: Keep-Alive\n" |
/usr/local/publicfile/bin/httpd /public/file

(after the "echo" everything on 1 line)

In the file:

/public/file/blocked/index.html

you can put whatever you want. If you connect to 127.0.0.1 port 80, you
will always get the contents of /public/file/blocked/index.html

R.

-- 
___________________________________________________________________
It is better to remain silent and be thought a fool, than to speak
aloud and remove all doubt.

+------------------------------------------------------------------+
| Richard Lucassen, Utrecht                                        |
| Public key and email address:                                    |
| http://www.lucassen.org/mail-pubkey.html                         |
+------------------------------------------------------------------+