hi busybox friends,<br>&nbsp;i am trying to have a feel on how cgi is woking on busybox.<br>&nbsp;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>&nbsp;thank you.<br>
<br>&nbsp;i have busybox compiled on i686 system running fedora 8 in vmware on winxp.<br>&nbsp;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>&lt;html&gt;<br>&lt;head&gt;<br>&lt;title&gt;CGI Test&lt;/title&gt;<br>&lt;/head&gt;<br><br>&lt;body&gt;<br>&lt;form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;/cgi-bin/test-post&quot;&gt;<br>
&nbsp; &lt;p&gt;Text field<br>&nbsp;&nbsp;&nbsp; &lt;input name=&quot;Text_Field&quot; type=&quot;text&quot; id=&quot;Text_Field&quot;&gt;<br>&nbsp; &lt;/p&gt;<br>&nbsp; &lt;p&gt;Radio button&nbsp; &lt;/p&gt;<br>&nbsp; &lt;p&gt;<br>&nbsp;&nbsp;&nbsp; &lt;input name=&quot;Radio_Button&quot; type=&quot;radio&quot; value=&quot;1&quot;&gt; 1 <br>
&nbsp; &lt;/p&gt;<br>&nbsp; &lt;p&gt;<br>&nbsp;&nbsp;&nbsp; &lt;input name=&quot;Radio_Button&quot; type=&quot;radio&quot; value=&quot;2&quot;&gt; 2<br>&nbsp; &lt;/p&gt;<br>&nbsp; &lt;p&gt;<br>&nbsp;&nbsp;&nbsp; &lt;input name=&quot;Radio_Button&quot; type=&quot;radio&quot; value=&quot;3&quot;&gt; 3<br>
&nbsp; &lt;/p&gt;<br>&nbsp; &lt;p&gt;Some text &lt;/p&gt;<br>&nbsp; &lt;p&gt;<br>&nbsp;&nbsp;&nbsp; &lt;textarea name=&quot;Text_Area&quot; id=&quot;Text_Area&quot;&gt;&lt;/textarea&gt;<br>&nbsp; &lt;/p&gt;<br>&nbsp; &lt;p&gt;&amp;nbsp;&lt;/p&gt;<br>&nbsp; &lt;p&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &lt;input type=&quot;reset&quot; name=&quot;Reset&quot; value=&quot;Reset&quot;&gt;<br>&nbsp; &lt;/p&gt;<br>&nbsp; &lt;p&gt;&amp;nbsp;&lt;/p&gt;<br>
&nbsp; &lt;p&gt;&amp;nbsp;&lt;/p&gt;<br>&lt;/form&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;<br>--------------------------------------<br>#!/bin/sh<br>echo &quot;Content-type: text/html&quot;<br>echo &quot;&quot;<br>echo &quot;&lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;Sample CGI Output&lt;/TITLE&gt;&lt;/HEAD&gt;&quot;<br>
echo &quot;&lt;BODY&gt;&quot;<br>echo &quot;&lt;pre&gt;&quot;<br>echo &quot;Environment variables&quot;<br>echo &quot;&quot;<br>env<br>echo &quot;&quot;<br>echo &quot;=========================================================&quot;<br>
echo &quot;&quot;<br>echo &quot;Form variables :&quot;<br>echo &quot;&quot;<br>read QUERY_STRING<br>eval $(echo &quot;$QUERY_STRING&quot;|awk -F&#39;&amp;&#39; &#39;{for(i=1;i&lt;=NF;i++){print $i}}&#39;)<br>tmp=`httpd -d $Text_Field`<br>
echo &quot;Text_Field=$tmp&quot;<br>tmp=`httpd -d $Radio_Button`<br>echo &quot;Radio_Button=$tmp&quot;<br>tmp=`httpd -d $Text_Area`<br>echo &quot;Text_Area=$tmp&quot;<br>echo &quot;&lt;/pre&gt;&quot;<br>echo &quot;&lt;/BODY&gt;&lt;/HTML&gt;&quot;<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>&nbsp;&nbsp; or: function [arguments]...<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BusyBox is a multi-call binary that combines many common Unix<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; utilities into a single executable.&nbsp; Most people will create a<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; link to busybox for each function they wish to use and BusyBox<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; will act like whatever it was invoked as!<br><br>Currently defined functions:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; httpd<br><br><br><br>