[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: accessing programs through CGI
Hi Bilal,
You can add the following line to /mnt/flash/etc/httpd/conf/boa.conf
ScriptAlias /bin/ /mnt/flash/html-bin/
Create the directory /mnt/flash/html-bin
Create a file readbits in /mnt/flash/html-bin containing the following
#!/bin/sh
echo Content-Type: text/html
echo
echo '<html><pre>'
readbits
echo '</pre></html>'
Then mark this file executable
chmod a+x readbits
Then your example should work as expected.
If you want to ensure you do not have problems with browser caching etc you
can add some more headers to the script
#!/bin/sh
echo Content-Type: text/html
echo Expires: Tue, 17 Jun 1979 02:20:00
echo Expires: 0
echo Pragma: no-cache
echo Cache-Control: no-cache
echo
echo '<html><pre>'
readbits
echo '</pre></html>'
Hope that helps!
Regards,
Chris Poole
----- Original Message -----
From: <B.Ashraf@xxxxxxx.uk>
To: <dev-etrax@xxxxxxx.com>
Sent: Friday, February 28, 2003 12:07 PM
Subject: accessing programs through CGI
> Dear Friends
>
> 1. How do I access programs in /bin directory from index.html?
>
> I tried the following
> <A HREF="/bin/readbits">Test the GPIO</a>
>
> But the following message appears
>
> The requested URL was not found on the server. Error 404 Not Found
>
> 2. If i have to add this program to admin-bin directory how can I do that?
>
> cheers
> bilal
>
>