PCEngines WRAP 2.C - HTTP Redirector

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
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.

Re: PCEngines WRAP 2.C - HTTP Redirector
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:
Quoted text here. Click to load it

Re: PCEngines WRAP 2.C - HTTP Redirector
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)

2. 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
<VirtualHost *:10001>
  RewriteEngine on
  RewriteRule .* https://foo.bar.com?client_ip =% [L,R]
</VirtualHost>

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.

Re: PCEngines WRAP 2.C - HTTP Redirector

Quoted text here. Click to load it
.....

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 - http://www.acme.com/software/thttpd /

/devlin

--->>> index.cgi
#!/bin/sh
echo "Location: https://foo.bar.com?client_ip =$"
echo -n "Date: "
date -R
echo "Content-type: text/html"
echo ""
---<<< index.cgi


Re: PCEngines WRAP 2.C - HTTP Redirector

Quoted text here. Click to load it

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?

Re: PCEngines WRAP 2.C - HTTP Redirector
I got it working...

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

Site Timeline