Discussion:
[Gambas-user] gb.web
Mike Crean
2013-02-21 12:35:32 UTC
Permalink
Hi Benoit,

I am trying to get a Gambas 3 web
server up and running using gb.web I just do not get it at all. I
have looked at a lot of examples and threads but I just can not get a
web server page up and running. I am using Apache2 and Gambas 3.4
with gb.web enabled. The aim is to use Gambas 3 within a HTML page to
get data from a communications port (ttyACM0) and display the data as
text or other on the HTML page. Also would like to send data from a
HTML page with the push of a button or text box to a serial device
(ttyACM0). The device would be an Arduino.

Hope you can help with an example and
any changes I would have to make to files and directors for Gambas 3
and Apache2. The OS is Ubuntu 12.04. If this is to much to ask
perhaps you can suggest someone that can help me.

Best Regards
Mike Crean
Jussi Lahtinen
2013-02-21 15:25:29 UTC
Permalink
Please be more specific.
Send your project and tell us what it is supposed to do and what happens
instead.
Or specifically what doesn't work.

Here is example of server page. It doesn't work?
http://gambasdoc.org/help/doc/serverpage?view

Jussi
Post by Mike Crean
Hi Benoit,
I am trying to get a Gambas 3 web
server up and running using gb.web I just do not get it at all. I
have looked at a lot of examples and threads but I just can not get a
web server page up and running. I am using Apache2 and Gambas 3.4
with gb.web enabled. The aim is to use Gambas 3 within a HTML page to
get data from a communications port (ttyACM0) and display the data as
text or other on the HTML page. Also would like to send data from a
HTML page with the push of a button or text box to a serial device
(ttyACM0). The device would be an Arduino.
Hope you can help with an example and
any changes I would have to make to files and directors for Gambas 3
and Apache2. The OS is Ubuntu 12.04. If this is to much to ask
perhaps you can suggest someone that can help me.
Best Regards
Mike Crean
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Mike Crean
2013-02-22 00:53:43 UTC
Permalink
Hi Jussi,

Thanks for the reply.
I have tried the example you have pointed to and can not get it to
work.
All I need to do is take data from a serial stream e.g.
Stuff = "A01 ON" and use the print statement to display
the
string A01 ON on a HTML web page. I have Apache running ok and
can display an index.html page from /var/www
when I connect to
http://localhost/
I have tried entering this code in the
index.html file, I don't get the desired result as it just displays
the text and not the
print statement as such, it displays all
the file <% and %> etc.

<html>
<body>

<h1>Gambas3
Web Server.</h1>
<%
print Stuff
or print "A01
ON"
%>

</body>
</html>

Mike


________________________________
From: Jussi Lahtinen <***@gmail.com>
To: mailing list for gambas users <gambas-***@lists.sourceforge.net>
Sent: Thursday, 21 February 2013 11:25 PM
Subject: Re: [Gambas-user] gb.web

Please be more specific.
Send your project and tell us what it is supposed to do and what happens
instead.
Or specifically what doesn't work.

Here is example of server page. It doesn't work?
http://gambasdoc.org/help/doc/serverpage?view

Jussi
Post by Mike Crean
Hi Benoit,
I am trying to get a Gambas 3 web
server up and running using gb.web I just do not get it at all. I
have looked at a lot of examples and threads but I just can not get a
web server page up and running. I am using Apache2 and Gambas 3.4
with gb.web enabled. The aim is to use Gambas 3 within a HTML page to
get data from a communications port (ttyACM0) and display the data as
text or other on the HTML page. Also would like to send data from a
HTML page with the push of a button or text box to a serial device
(ttyACM0). The device would be an Arduino.
Hope you can help with an example and
any changes I would have to make to files and directors  for Gambas 3
and Apache2. The OS is Ubuntu 12.04. If this is to much to ask
perhaps you can suggest someone that can help me.
Best Regards
Mike Crean
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Bruce
2013-02-22 01:36:00 UTC
Permalink
Post by Mike Crean
Hi Jussi,
Thanks for the reply.
I have tried the example you have pointed to and can not get it to
work.
All I need to do is take data from a serial stream e.g.
Stuff = "A01 ON" and use the print statement to display
the
string A01 ON on a HTML web page. I have Apache running ok and
can display an index.html page from /var/www
when I connect to
http://localhost/
I have tried entering this code in the
index.html file, I don't get the desired result as it just displays
the text and not the
print statement as such, it displays all
the file <% and %> etc.
<html>
<body>
<h1>Gambas3
Web Server.</h1>
<%
print Stuff
or print "A01
ON"
%>
</body>
</html>
Mike
Have you included the "magic" line at the top? If not, the server will
just send the text of the file as is.

#!/bin/env /usr/bin/gbw3

<html>

<h1>Gambas3 Web Server.</h1>

<%
print "A01 ON"
%>

</html>

works fine here.

hth
Bruce
Mike Crean
2013-02-22 12:20:04 UTC
Permalink
Hi Bruce,

Thanks
for the suggestions, I have tried them to no avail. It would seem
there is a very full on learning curve to get this up and running.
Perhaps
there is a much simpler way using something other than Gambas.
Again
thanks for you help Bruce. Perhaps Randall's comments about the
Apache CGI set-up has some merit. Again have read some suggestions as
to how to set-up CGI on Apache and tried many. My aim is to get this
all working on a standard deb OS install on Rpi with Gambas ?? and
Apache 2 standard out of the box installs.


Thanksboys I am open to any other suggestions.

Regards

Mike
Tobias Boege
2013-02-22 13:18:18 UTC
Permalink
Post by Mike Crean
Hi Bruce,
Thanks
for the suggestions, I have tried them to no avail. It would seem
there is a very full on learning curve to get this up and running.
Perhaps
there is a much simpler way using something other than Gambas.
Again
thanks for you help Bruce. Perhaps Randall's comments about the
Apache CGI set-up has some merit. Again have read some suggestions as
to how to set-up CGI on Apache and tried many. My aim is to get this
all working on a standard deb OS install on Rpi with Gambas ?? and
Apache 2 standard out of the box installs.
Thanksboys I am open to any other suggestions.
You can't get this working with "Apache 2 standard out of the box installs".
You must configure Apache to recognise Gambas webpages as CGI scripts to
call the gbw3 interpreter.

I could send you an archive with a test project an a German PDF explaining
the Apache2 configuration for Gambas-CGI, but only in private conversation
because it's too big for this mailing list to be an attachment (~1.2MiB).

Regards,
Tobi
Jussi Lahtinen
2013-02-22 18:16:32 UTC
Permalink
Post by Tobias Boege
You can't get this working with "Apache 2 standard out of the box installs".
You must configure Apache to recognise Gambas webpages as CGI scripts to
call the gbw3 interpreter.
I could send you an archive with a test project an a German PDF explaining
the Apache2 configuration for Gambas-CGI, but only in private conversation
because it's too big for this mailing list to be an attachment (~1.2MiB).
It would be great if you could append this information to documentation:
http://gambasdoc.org/help/doc/serverpage?view

Apache is probably the most popular choice and so it would help many people.

Jussi
Tobias Boege
2013-02-23 07:20:44 UTC
Permalink
Post by Jussi Lahtinen
Post by Tobias Boege
You can't get this working with "Apache 2 standard out of the box installs".
You must configure Apache to recognise Gambas webpages as CGI scripts to
call the gbw3 interpreter.
I could send you an archive with a test project an a German PDF explaining
the Apache2 configuration for Gambas-CGI, but only in private conversation
because it's too big for this mailing list to be an attachment (~1.2MiB).
http://gambasdoc.org/help/doc/serverpage?view
Apache is probably the most popular choice and so it would help many people.
Hmm. Good idea but the stuff is made entirely by Hans not by me. It's
already dated to pre-Gambas-webpage days (all code (probably Gambas2) uses
PRINT to generate HTML) so I must translate and rework it.

But I think it's worth it...

Regards,
Tobi
Mike Crean
2013-02-22 15:30:29 UTC
Permalink
Hi Tobi,
Thanks
for the offer I would like some help. You can get me at
***@y7mail.com
any
help is appreciated.

Regards
Mike
Mike Crean
2013-02-23 11:43:15 UTC
Permalink
Hi Randall,
 
If Tobi is on the side perhaps he can check with Hans' if it is OK to release my English version of
his work.
 
Regards
Mike
Mike Crean
2013-02-23 11:46:20 UTC
Permalink
Randall, perhaps I should wait untill I have it all working then document it all and have it posted up
on the Gambas web site.
 
Mike
Randall Morgan
2013-02-23 12:50:30 UTC
Permalink
Ok, can you give me a link to the German version?
Post by Mike Crean
Randall, perhaps I should wait untill I have it all working then document it all and have it posted up
on the Gambas web site.
Mike
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
--
If you ask me if it can be done. The answer is YES, it can always be
done. The correct questions however are... What will it cost, and how
long will it take?
Tobias Boege
2013-02-23 14:42:49 UTC
Permalink
Post by Randall Morgan
Ok, can you give me a link to the German version?
Post by Mike Crean
Randall, perhaps I should wait untill I have it all working then document it all and have it posted up
on the Gambas web site.
Mike
Hmm. I read Hans' article and my personal impression is: it's too big.

I mean: the first part is about installing and configuring apache2's userdir
module and stuff on some past Ubuntu which is - strictly - out of scope and
should be stripped. There are other tutorials on that.

Next, is the important CGI stuff.

Then comes practise: using GET and POST methods, MySQL and SSI where the
first two are Gambas practise and SSI is just about some HTML.

I'd summarise the whole 14 pages of the document like:

---
Configure your apache to your own taste - you may want to use the userdir
module -; find one of the tutorials out there if you need. However, to mark
Gambas executables as CGI scripts, add this line to your configuration:

AddHandler cgi-script .gambas

and the following ones to all CGI-executable Directory blocks:

Options +ExecCGI
SetHandler cgi-script

Don't forget that Gambas comes with lots of components: you can access MySQL
databases, etc. etc. pp.. Since Gambas 3.1.0 there are also Gambas webpages.
See the documentation for details.
---

If it helps, I can convert and rewrite all the examples included in Hans'
distribution to Gambas3 but I would only take Mike's offer to check his
translation and not translate myself.

Regards,
Tobi
Christer Johansson
2013-02-27 08:38:49 UTC
Permalink
Post by Tobias Boege
You can't get this working with "Apache 2 standard out of the
box installs".
You must configure Apache to recognise Gambas webpages as CGI
scripts to call the gbw3 interpreter.
I could send you an archive with a test project an a German PDF explaining
the Apache2 configuration for Gambas-CGI, but only in private conversation
because it's too big for this mailing list to be an attachment (~1.2MiB).
Do you know if same applies for lighttdp server? I tried to get Gambas 3
and CGI working before but could never get it to work...

/CJ
Tobias Boege
2013-02-27 17:06:04 UTC
Permalink
Post by Christer Johansson
Post by Tobias Boege
You can't get this working with "Apache 2 standard out of the box installs".
You must configure Apache to recognise Gambas webpages as CGI
scripts to call the gbw3 interpreter.
I could send you an archive with a test project an a German PDF explaining
the Apache2 configuration for Gambas-CGI, but only in private conversation
because it's too big for this mailing list to be an attachment (~1.2MiB).
Do you know if same applies for lighttdp server? I tried to get Gambas 3
and CGI working before but could never get it to work...
/CJ
I don't know, never used it. But essentially you just have to configured
your httpd to recognised .gambas as an executable CGI script. That's all.

Regards,
Tobi
Fabien Bodard
2013-02-27 17:49:51 UTC
Permalink
lighttpd is quite simple to configure
Post by Tobias Boege
Post by Christer Johansson
Post by Tobias Boege
You can't get this working with "Apache 2 standard out of the box installs".
You must configure Apache to recognise Gambas webpages as CGI
scripts to call the gbw3 interpreter.
I could send you an archive with a test project an a German PDF
explaining
Post by Christer Johansson
Post by Tobias Boege
the Apache2 configuration for Gambas-CGI, but only in private
conversation
Post by Christer Johansson
Post by Tobias Boege
because it's too big for this mailing list to be an attachment
(~1.2MiB).
Post by Christer Johansson
Do you know if same applies for lighttdp server? I tried to get Gambas 3
and CGI working before but could never get it to work...
/CJ
I don't know, never used it. But essentially you just have to configured
your httpd to recognised .gambas as an executable CGI script. That's all.
Regards,
Tobi
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
--
Fabien Bodard
Loading...