PCEngines WRAP 2.C - HTTP Redirector - Embedded

This is a discussion on PCEngines WRAP 2.C - HTTP Redirector - Embedded ; 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 ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: PCEngines WRAP 2.C - HTTP Redirector

  1. 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.

  2. 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




    foo@bar.com wrote:
    > 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.


  3. 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

    RewriteEngine on
    RewriteRule .* https://foo.bar.com?client_ip=%{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.

  4. Re: PCEngines WRAP 2.C - HTTP Redirector

    On Mon, 26 Jun 2006 21:18:52 +0000, foo wrote:

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

    ......
    >
    > Listen *:10001 # The port to listen for
    >
    > RewriteEngine on
    > RewriteRule .* https://foo.bar.com?client_ip=%{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.


    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=${REMOTE_ADDR}"
    echo -n "Date: "
    date -R
    echo "Content-type: text/html"
    echo ""
    ---<<< index.cgi


  5. Re: PCEngines WRAP 2.C - HTTP Redirector

    Devlin Doe wrote in
    newsan.2006.06.27.20.53.22.467295@zion.piratefish.net:

    > On Mon, 26 Jun 2006 21:18:52 +0000, foo wrote:
    >
    >> 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...
    >>

    > .....
    >>
    >> Listen *:10001 # The port to listen for
    >>
    >> RewriteEngine on
    >> RewriteRule .* https://foo.bar.com?client_ip=%{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.

    >
    > 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=${REMOTE_ADDR}"
    > echo -n "Date: "
    > date -R
    > echo "Content-type: text/html"
    > echo ""
    > ---<<< index.cgi
    >
    >


    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?

  6. Re: PCEngines WRAP 2.C - HTTP Redirector

    I got it working...

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

+ Reply to Thread