PDA

Bekijk de volledige versie : Special httpd.



barsju
18-03-2005, 12:45
Hi, I need to make a httpd that responds with the same html document no matter what document you look for. I have tried by putting


ErrorDocument 404 404.html

In httpd.conf but I can't make that work. Does anyone have any idea how to do this, or perhaps another solution?

I am a linux n00b and haven't gotten around to compiling or anything for the wl500g, but if someone has 5 minutes free time perhaps they could make a small deamon that listens to a socket and returns a html file (or possibly a results form a script) Something like

dummyhttp 81 returnScript.sh &

listen($1)
on connect: write `$2`
close connection


S.

barsju
26-03-2005, 12:08
Ok, no responses here, but what about inetd? I found it in the full busybox binary. Can it be done there by setting up a service that runs a script that returns a http header and a html-doc?

I tried setting up a hello-world program like this:
Script hello:


#!/bin/sh
/bin/echo "Hello world" `/bin/date`

inetd.conf:


hello stream tcp nowait admin /tmp/harddisk/hello hello

Added this line to /etc/services:


hello 3333/tcp #Hello world

And started inetd with this command:


full_busybox inetd inetd.conf


When i try to telnet localhost 3333 i get "telnet: Unable to connect to remote host (127.0.0.1): Connection refused", and I can't find a 3333 or hello entry in netstat -a

So what am I doing wrong? Misunderstood something? Something to do with the fact that there is nowhere to specify which interface to listen to? Dosen't inetd work with scripts like that? Do I need xinetd instead? (The example I followed was for xinetd...)

If I need xinetd has any one compiled it yet? Can someone do it please :)

All help is greatly appreciated!

S.