freebasic + monkey

Post Reply
Message
Author
eusebe
Posts: 6
Joined: Wed 18 Mar 2009, 23:11

freebasic + monkey

#1 Post by eusebe »

BONJOUR.
Sous Puppy de par le port RS232 + un port // je dois envoyer des commandes à des cartes éléctroniques . J'ai choisi de faire des applications sur un serveur ( Monkey ) puis lier des pages html avec des scripts écrit en Freebasic( il est trés facile pour utiliser les ports série et // ). J'ai installer Monkey comme serveur , puis Freebasic.
Le probléme où je butte est de configurer Monkey à accepter les scripts cgi en Freebasic.
Si quelqu'un a déjà fait cela ou connait un tuto j'en serais trés content.

Merci d'avance.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#2 Post by MU »

salut,
install avec petget "monkey".
Pardon, je vais ecrire en anglais, c'est plus facile pour mois.
Si tu ne comprends pas, s'il te plait demande ce qu'il n'est pas claire, et je vais l'essaier en francais.
Je comprends tous ce que je lis, mais ecrire, ca fait 20 ans deja...

Edit /root/monkey/conf/monkey.conf

Code: Select all

# Server_ScriptAlias /cgi-bin/ /home/services/httpd/cgi-bin
to:

Code: Select all

# Server_ScriptAlias /cgi-bin/ /home/services/httpd/cgi-bin
Server_ScriptAlias /cgi-bin/ /root/monkey/public_html/cgi-bin/
Click on the monkey icon in /root/ with Rox-filer.
It runs a small utility to start/stop.
Start the server.
If you use another filemanager, click on /root/Monkey-Web-Server/Apprun.

In the webbrowser, type:
http://127.0.0.1/
You now should see the monkey page.

Now create a script:
/root/monkey/public_html/cgi-bin/test.cgi

Code: Select all

#!/bin/bash

echo -e "Content-Type: text/html\n\n"

echo "success!"
Make it executable by typing in a console:
chmod 755 /root/monkey/public_html/cgi-bin/test.cgi

In the webbrowser, enter:
http://127.0.0.1/cgi-bin/test.cgi

You now should see: "success!".
Not more!

If this works, replace test.cgi with a small executable, you made with freebasic.
I think freebasic has an own cgi binding, so it might send a header automatically.
If not, it is important to print as first line:
"Content-Type: text/html\n\n"
If you do not print this, your script will not work, as CGI requires such a header information.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

eusebe
Posts: 6
Joined: Wed 18 Mar 2009, 23:11

#3 Post by eusebe »

Thanks a lot.

Eusèbe.

Post Reply