This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Beaglebone Lighttpd cgi c program

Hi,

I have a Beaglebone Rev. A6a with TI Sitara OS installed.
I want to test a simple cgi program written in C with cgi and Lighttpd.


I have configured the Lighttpd as below for the cgi bin:

--------------------------------------------------------------------------------------

server.modules = (
            "mod_cgi"
         )

server.document-root = "/www/pages/"

server.port = 80

mimetype.assign = (
    ".html" => "text/html",
    ".txt" => "text/plain",
    ".jpg" => "image/jpeg",
    ".png" => "image/png"
)

index-file.names = ( "index.html" )

cgi.assign = (".cgi" => "/usr/bin/php-cgi")
--------------------------------------------------------------------------------------



I have made a file index.html as this for to test the c cgi bin with the POST method:

<form action="test.cgi" method="POST">
First Name: <input type="text" name="first_name">  <br />
Last Name: <input type="text" name="last_name" />
<input type="submit" value="Submit" />
</form>

I have cross-compiled a test.c program and I have put it in the Beaglebone renamed as test.cgi.

The problem is about the method POST.
When I send data with the Submit button in the browser, the POST method fail.
The cgi program don't receive the data.
The enviroment variable "CONTENT_LENGTH" is 0.
The browser execute the cgi bin and show a lot of characters...

Can anyone help me about the configuration of Lighttpd and cgi c program...?
Many thanks in advance
  • Hi Giacomo,

    There is plenty of information about this on the web. This issue isn't related to the processor or the underlying Linux OS, so please search the web.

    You can try this in your lighthttpd.conf file:

    $HTTP["url"] =~ "/cgi-bin/" {
            cgi.assign = ( "" => "" )
    }

    cgi.assign = (".cgi"  => "")

    Best regards,
    Miroslav