[Klone-users] kl1 as CGI
Stefano Barbato
barbato at koanlogic.com
Thu Jun 4 10:20:46 EDT 2009
Hi Mauro,
Are you working on a Fox board right?
The attached klone-app is an example (for the foxboard but you can
change the target platform modifying the MAKL_PLATFORM var in the top-
level Makefile) that should suit your needs.
this is how you can build the example app:
- source the foxboard environment file
cd /path/to/devboard-R2_01 && . init_env
- untar the attached package somewhere
tar zxvf mauro-fox.tar.gz
cd mauro-fox
- build klone
make
- copy the kloned binary, the configuration file (kloned.conf) and the
www/ directory (static files) in /mnt/flash
- make 'kloned' executable
chmod +x /mnt/flash/kloned
- telnet into the fox and start kloned
/mnt/flash/kloned -f /mnt/flash/kloned.conf
- try it out
http://fox:8080/
If you want to modify the application remember that:
- all static files go in /mnt/flash/www
- dynamic pages (.kl1) go in the webapp/kl1 directory (on the
development machine); after that you must recompile and reinstall
'kloned'
stefano
On 04/giu/09, at 14:23, ripar wrote:
> Hi to all,
> I'm really going mad. I've two file: index.html e prova.kl1, that I
> want to call as a simple CGI. In fact, I would like to use klone as
> a normal web server but i want to keep the C language power for
> scripting.
>
>
> ----------------------- Index.htm -------------------------------
> <HTML>
> <BODY>
>
> BLA....BLA.....BLA
>
> <FORM METHOD="GET" ACTION="cgi/prova.kl1">
> <p>Type something here: <INPUT NAME="nameoffield"></p>
> <p>INPUT TYPE="SUBMIT"></p>
> </FORM>
>
> </BODY>
> </HTML>
>
> ------------------ prova.kl1-------------------------
> #!/mnt/flash/klone
>
>
> <body>
> PROVA 10
> <%
> io_printf(out, "PIPPO");
>
> DIR *dirp;
> struct dirent *dp;
>
> dirp = opendir("/");
> while ((dp = readdir(dirp)) != NULL)
> io_printf(out, "<li>%s</li>", dp->d_name);
> closedir(dirp);
> %>
>
> </body>
> ---------------------------------
>
> I've compiled with --install_daemon_only e --ebable_sup_cgi, but
> when I call the script the resulting page it's always blank. Which
> interpreter I've to use (klone?)? Is it native the c language
> interpretation?
>
> Please, I'm really going mad..... can give some working example?
>
> Thanks a lot
> Mauro
>
>
>
>
>
>
>
> 2009/6/3 ripar <riparz at gmail.com>
> Hello Thomas,
> thanks a lot for your info. I've compiled the kloned deamon as your
> indication and changed the kloned.conf file. Anyway, I can see
> simple html files but when I tray to call a kl1 file the only one i
> can see is a blank page.
>
> Do you have some example of kl1 files usage?
>
> Thanks a lot
> Mauro
>
> 2009/6/3 thomas fossati <tho at koanlogic.com>
>
> Hi Mauro,
>
>
> On Jun 2, 2009, at 6:18 PM, ripar wrote:
> I would like tu use C code (in Kl1 file) ad simple (and not
> embedded) cgi script. To do this, I've compiled the klone as act as
> a normal web server. Is it possible?
>
>
> yes, you need to add "KLONE_CONF_ARGS += --enable_sup_cgi" to your
> Makefile and a minimal "cgi" section to the backend configuration in
> your kloned.conf file (see klone-2.2.0/build/target/klone-core-2.2.0/
> etc/kloned-cgi.conf).
>
> ciao, t.
>
> _______________________________________________
> Klone-users mailing list
> Klone-users at koanlogic.com
> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
>
>
> _______________________________________________
> Klone-users mailing list
> Klone-users at koanlogic.com
> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mauro-fox.tar.gz
Type: application/x-gzip
Size: 1328 bytes
Desc: not available
Url : http://koanlogic.com/pipermail/klone-users/attachments/20090604/f9f97f46/mauro-fox.tar.bin
More information about the klone-users
mailing list