PCEngines WRAP 2.C - HTTP Redirector

This is my first foray into the embedded linux world so I can use all of the help anyone can offer.

I have a requirement for a device that will force an HTTP redirect. It needs to listen for requests on a predetermined port and reply to those requests with a URL that the user is to be redirected to. Apache running on a Linux server does this quite nicely with a few lines of code in a CONF file.

However, I don't want a server with moving parts thrown into my network which currently consists of Cisco routers and switches. In addition, this is a network model that will have multiple instances and buying all of those servers will become cost prohibitive.

I have a PC Engines WRAP 2.C which should be able to act as a "redirector on a stick" given the write Compact Flash image. There is an abundance of turnkey OS images for the WRAP 2.C but all of the ones I have come across are either firewalls or access points and such.

I would prefer not to get into cross compiling my own Linux distro as my lack of experience would seriously hinder my progress in such an effort. I was hoping someone could point me to a turnkey CF image for the WRAP board that functions as a configurable HTTPD server or just a barebones Linux distro that I could easily load such a HTTPD daemon onto.

If there is a distro for the WRAP board that just has serial/console support and some yum-type install functionality to make things easy for a nube like myself, that would be perfect.

Thanks in advance for everyones comments and suggestions.

Reply to
foo
Loading thread data ...

You have a few options..you can download snapgear and create your image there...

There is voyage that writes everything to a ram disk as to save the life of your compact flash card......go a bit more into detail on the project..and I will create an image for you

AlIoSa

snipped-for-privacy@bar.com wrote:

Reply to
Kerry

I'll try to give some more detail.

I need a CF image for the PC Engines WRAP 2.C that does specifically the following...

  1. Listens for HTTP requests on two seperate ports (the ports need to be configurable)

  1. Redirects those requests to a URL (again configurable) with the client IP address appended as a parameter.

An apache httpd server could accomplish this with the following being placed in a conf file in the apache conf.d directory (etc/httpd/conf.d):

Listen *:10001 # The port to listen for

RewriteEngine on RewriteRule .*

formatting link
{REMOTE_ADDR} [L,R]

I've been playing with AspisOS (aspisos.org) and their distro shows some promise. I've gotten the redirects to work and now I am trying to figure out how to append the IP address to the URL. Documentation for the OS itself and the optional "add-ons" is less than adequate.

Reply to
foo

.....

What you define a 'configurable' - and how/where you want to store that is up to you... Soo - your looking for a web server running at two port and executing the shell/CGI script below ? A bit overkill to use Apache for that task, I would suggest using thttpd instead -

formatting link

/devlin

--->>> index.cgi #!/bin/sh echo "Location:

formatting link
${REMOTE_ADDR}" echo -n "Date: " date -R echo "Content-type: text/html" echo ""

---

Reply to
Devlin Doe

Devlin Doe wrote in news: snipped-for-privacy@zion.piratefish.net:

I'm doing that currently with shttpd but it can't listen on two ports simultaneously. Listening for SSL simultaneously will not satisfy my requirements, but it appears that shttpd can't do that anyway. I need two HTTP ports. Looking at thttpd's man page, it looks like it has the same limitation. I'll give it a shot though.

This might seam like a silly question to someone more familiar with Linux OS than myself, but could I run two sperate instances of the server, say under two separte uid spaces or something like that?

Reply to
foo

I got it working...

I was able to run two instances of shttpd using the "nohup" command.

Reply to
foo

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.