OpenWrt Forum Archive

Topic: Looking for httpd feature

The content of this topic has been archived on 28 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all,

im looking for a http server for my OpenWrt (on wrt54g) where i can do the following:

The routing tables will redirect all requests to the openwrt

iptables -t nat -A PREROUTING -s 192.168.5.0/24 -p tcp --dport 80 -j REDIRECT

Then the http server will receive all requests. I want to respond with the same page for all requests.
So when the client requests http://forum.java.sun.com/forum.jspa?forumID=31  the server should repond every time with the same  page.

I puzzeled with the error page options in thttpd, but the problem is that IE when receives an error  code in the header fields does not render the page content, but the build-in error page.

Any idea what soft can do this ?

Thank you, Peter.

(Last edited by peterm on 6 May 2005, 12:47)

Try lighttpd, I just set it up doing what you want to do. 

I also got thttpd to work correctly.  You have to use a 'meta refresh' tag in you html doc to do the redirect.  I switched to thttpd because it supports https nativly, allowing me to capture http and https requests...

Ben

peterm wrote:

but the problem is that IE when receives an error  code in the header fields does not render the page content, but the build-in error page.

I think the page must exceed a certain size (1024 bytes?), then also IE shows the page correctly.

Bye,
Uwe

Hi Ben, hi Uwe

The 1kb hints helps me now. I will check  lighttpd later.

Many thanks for your comments.

Bye, Peter

Hi Ben,

maybe you can help another time. I'm puzzeling with lighttpd but i get not working the error page option and there is no so much doc available.

I think with this option i have enough or left i something:

## error-handler for status 404
#server.error-handler-404   = "/error-handler.php"
server.error-handler-404   = "/err404.html"

I get always a page that shows "404 - Not Found" and not my error page.

Thank you for your attention, Peter.

Peter,

I believe that is all you should need in your config.  Perhaps you have another problem, such as file permissions?  You might also try Firefox, as it sometimes will give a more descriptive error message.


This might save you some time once you get that working.  I had to use the following option to prevent the browser from using a persistent connection after I have updated my firewall rules:

server.max-keep-alive-requests = 0

Ben

Ben,

it does not work. I'm using FF anyway. The curious thing is, if my error page does'nt exist i get a message in the log. I will check out mini_httpd.

Thank you so far, Peter.

Can you access the error page explicitly? i.e.

http://<yourserver>/err404.html

If that works, then it's not file permissions.. Check config.
If it doesn't work, then you're getting a 404 for your 404 page. wink

The discussion might have continued from here.