hi busybox friends,<br> i am trying to have a feel on how cgi is woking on busybox.<br> but i still have problem while after i have several try, would anyone please teach me or give me a pointer so to make it running?<br> thank you.<br>
<br> i have busybox compiled on i686 system running fedora 8 in vmware on winxp.<br> i put busybox source in /home/keo/busybox and compile statically with only httpd. ( i tried a defconfig, but i hope a simplest compile will isolate problem).<br>
<br>then i mkdir www for webroot and cgi-bin within www.<br>then i launch with ./busybox httpd -h www -c $PWD/www/httpd.conf<br><br>i copy 2 files from internet. www/form-post.html and cgi-bin/test-post<br>but when i submit in the form-post.html which pass to test-post i get<br>
<div style="text-align: right;"><br></div>
404 Not Found<br>
<br>
The requested URL was not found<br><br>regards,-keo<br><br>-----------------------------------<br><html><br><head><br><title>CGI Test</title><br></head><br><br><body><br><form name="form1" method="post" action="/cgi-bin/test-post"><br>
<p>Text field<br> <input name="Text_Field" type="text" id="Text_Field"><br> </p><br> <p>Radio button </p><br> <p><br> <input name="Radio_Button" type="radio" value="1"> 1 <br>
</p><br> <p><br> <input name="Radio_Button" type="radio" value="2"> 2<br> </p><br> <p><br> <input name="Radio_Button" type="radio" value="3"> 3<br>
</p><br> <p>Some text </p><br> <p><br> <textarea name="Text_Area" id="Text_Area"></textarea><br> </p><br> <p>&nbsp;</p><br> <p><br>
<input type="submit" name="Submit" value="Submit"><br> <input type="reset" name="Reset" value="Reset"><br> </p><br> <p>&nbsp;</p><br>
<p>&nbsp;</p><br></form><br></body><br></html><br>--------------------------------------<br>#!/bin/sh<br>echo "Content-type: text/html"<br>echo ""<br>echo "<HTML><HEAD><TITLE>Sample CGI Output</TITLE></HEAD>"<br>
echo "<BODY>"<br>echo "<pre>"<br>echo "Environment variables"<br>echo ""<br>env<br>echo ""<br>echo "========================================================="<br>
echo ""<br>echo "Form variables :"<br>echo ""<br>read QUERY_STRING<br>eval $(echo "$QUERY_STRING"|awk -F'&' '{for(i=1;i<=NF;i++){print $i}}')<br>tmp=`httpd -d $Text_Field`<br>
echo "Text_Field=$tmp"<br>tmp=`httpd -d $Radio_Button`<br>echo "Radio_Button=$tmp"<br>tmp=`httpd -d $Text_Area`<br>echo "Text_Area=$tmp"<br>echo "</pre>"<br>echo "</BODY></HTML>"<br>
<br><br><br><br>[root@fedora8 busybox]# pwd<br>/home/keo/busybox<br><br>[root@fedora8 busybox]# file busybox<br>busybox: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically<br>linked, for GNU/Linux 2.6.9, stripped<br>
<br>[root@fedora8 busybox]# ./busybox<br>BusyBox v1.10.1 (2008-05-05 10:35:41 HKT) multi-call binary<br>Copyright (C) 1998-2007 Erik Andersen, Rob Landley, Denys Vlasenko<br>and others. Licensed under GPLv2.<br>See source distribution for full notice.<br>
<br>Usage: busybox [function] [arguments]...<br> or: function [arguments]...<br><br> BusyBox is a multi-call binary that combines many common Unix<br> utilities into a single executable. Most people will create a<br>
link to busybox for each function they wish to use and BusyBox<br> will act like whatever it was invoked as!<br><br>Currently defined functions:<br> httpd<br><br><br><br>