Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-05

fpweb with fcgi samples

40 messages · 10 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bee Jay

Hi all,

I'm about to study fpWeb and its FCGI support. But I didn't see any example that are using FCGI in SVN trunk. There are only CGIs and Apache modules. Can they be used with FCGI simply by changing the used unit? I also couldn't find any suffiecient docs about the FCGI support. Any hints?

TIA.

-Bee-

Reply by email

Michael Van Canneyt
to Bee Jay
Bee Jay wrote 7 lines
Hi all, I'm about to study fpWeb and its FCGI support. But I didn't see any example that are using FCGI in SVN trunk. There are only CGIs and Apache modules. Can they be used with FCGI simply by changing the used unit? I also couldn't find any suffiecient docs about the FCGI support. Any hints?

You just need to create a fastcgi application (lazarus file-new then Project/FastCGI application). It will automatically create a module. But you can include the modules you need from other applications.

The only difference between the CGI/FastCGI/Module/Embedded is that the project type is different. The actual code is the same.

Michael.

Reply by email

Bee Jay
to Michael Van Canneyt
Michael Van Canneyt wrote
You just need to create a fastcgi application (lazarus file-new then Project/FastCGI application). It will automatically create a module. But you can include the modules you need from other applications.

I'll try. I knew about fpWeb before but I never really touch it. :)

The only difference between the CGI/FastCGI/Module/Embedded is that the project type is different. The actual code is the same.

Is there any docs about FCGI? Supported FCGI feature? Unsupported feature? Limitations? Advantages? etc.

TIA.

-Bee-

Reply by email

Joost van der Sluis
to Bee Jay: I'm about to study fpWeb and its FCGI support. But I didn't see any example that are…
Bee Jay wrote
I'm about to study fpWeb and its FCGI support. But I didn't see any example that are using FCGI in SVN trunk. There are only CGIs and Apache modules. Can they be used with FCGI simply by changing the used unit? I also couldn't find any suffiecient docs about the FCGI support. Any hints?

Yes, in principle you only have to change the unit in you project file.

And further there is no real difference between a cgi and a fcgi application.

And when you use the embedded-webserver version. (Also only by changing the unit) you can directly run the application inside the debugger.

Joost.

Reply by email

Michael Van Canneyt
to Joost van der Sluis
Joost van der Sluis wrote 11 lines
On Thu, 2010-05-27 at 16:36 +0700, Bee Jay wrote: > I'm about to study fpWeb and its FCGI support. But I didn't see any example that are using FCGI in SVN trunk. There are only CGIs and Apache modules. Can they be used with FCGI simply by changing the used unit? I also couldn't find any suffiecient docs about the FCGI support. Any hints? Yes, in principle you only have to change the unit in you project file. And further there is no real difference between a cgi and a fcgi application. And when you use the embedded-webserver version. (Also only by changing the unit) you can directly run the application inside the debugger.

You can do this for fcgi as well, if you set the port number before the Run statement. Requires the use of ExternalCGI feature in Apache, or the new CGI->FastCGI gateway.

Michael.

Reply by email

silvioprog
to Bee Jay: I'm about to study fpWeb and its FCGI support. But I didn't see any example that are…
Bee Jay wrote 7 lines
Hi all, I'm about to study fpWeb and its FCGI support. But I didn't see any example that are using FCGI in SVN trunk. There are only CGIs and Apache modules. Can they be used with FCGI simply by changing the used unit? I also couldn't find any suffiecient docs about the FCGI support. Any hints? TIA. -Bee-

I also have much interest.

I am studying a way to create applications to run in the browser.

My current study:

. Apache+FastCGI+Gateway
. fpWeb
. HTML+CSS+JS

If you find any helps (about FCGI + FPC), please share with us.

Thanks.

Silvio Clecio $ programmer ObjectPascal - <http://silvioprog.com.br> $ Acesse nosso canal IRC sobre Lazarus no Brasil - #lazarus-br

Reply by email

Leonardo M. Ramé
to silvioprog

Hi, I want to show a little example of an CGI app I created this weekend using Lazarus with a package called FreeSpider, very similar to fpWeb. It runs on a 512mb of ram Debian i386 server hosted in Argentina in a shared hosting account.

The module consists of only two .pas files, one to handle the database connection, using fcl-db (MySql) and the other to handle the CGI requests. In total it required approx. 300 lines of code.

Apart from the pascal code, I used four html templates to "draw" the page header and the modules called home (for the first page), search for the "search engine" and "aerodromo" to show the airport data sheet.

http://www.aeropuertosarg.com.ar/cgi-bin/aerodromos

To use it simply type part of the name of the airport, or city or IATA code. For example type "a" and click "buscar" (search in spanish). For now it only has one airport "Aeroparque de la Ciudad de Buenos Aires", but it will grow in the future.

It'll show a list of coincidences, then click on one to see it's data sheet. That's all.

Leonardo M. Ram? Griensu S.A. - Medical IT C?rdoba Tel.: 0351-4247979

Reply by email

Michael Van Canneyt
to Leonardo M. Ramé

It would be an interesting test to see how easy you could re-create that in fcl-web.

Maybe we can learn something from this test, see how we can improve and/or simplify things.

Michael.

Leonardo M. Ram? wrote 35 lines
Hi, I want to show a little example of an CGI app I created this weekend using Lazarus with a package called FreeSpider, very similar to fpWeb. It runs on a 512mb of ram Debian i386 server hosted in Argentina in a shared hosting account. The module consists of only two .pas files, one to handle the database connection, using fcl-db (MySql) and the other to handle the CGI requests. In total it required approx. 300 lines of code. Apart from the pascal code, I used four html templates to "draw" the page header and the modules called home (for the first page), search for the "search engine" and "aerodromo" to show the airport data sheet. http://www.aeropuertosarg.com.ar/cgi-bin/aerodromos To use it simply type part of the name of the airport, or city or IATA code. For example type "a" and click "buscar" (search in spanish). For now it only has one airport "Aeroparque de la Ciudad de Buenos Aires", but it will grow in the future. It'll show a list of coincidences, then click on one to see it's data sheet. That's all. -- Leonardo M. Ram? Griensu S.A. - Medical IT C?rdoba Tel.: 0351-4247979 -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Leonardo M. Ramé
to Michael Van Canneyt

El jue, 27-05-2010 a las 22:43 +0200, Michael Van Canneyt escribi?:

Show quoted text 8 lines
It would be an interesting test to see how easy you could re-create that in fcl-web. Maybe we can learn something from this test, see how we can improve and/or simplify things. Michael.

Well this is a fairly trivial app, I'm sure I can recreate it in without problems with fpWeb and templates.

One interesting part of FreeSpider is that it includes an object oriented way to create HTML tables, this helps to avoid mixing HTML code with Object Pascal when you want to create tables from database data.

On the other hand, fpWeb has a more advanced templating engine, that maybe (I don't tested it) allows one to create rows of an HTML table right from the template, without creating it inside the program's code.

Leonardo M. Ram? Griensu S.A. - Medical IT C?rdoba Tel.: 0351-4247979

Reply by email

ABorka
to Leonardo M. Ramé
Leonardo M. Ram? wrote
On the other hand, fpWeb has a more advanced templating engine, that maybe (I don't tested it) allows one to create rows of an HTML table right from the template, without creating it inside the program's code.

Yes, this is true. See the demo program under your Lazarus diretory /components/fpweb/demo/fptemplate/listrecords/

You can use a tag in your template and complete eliminate html code in your pascal code. From the above demo program the template file contains:

{+REPORTRESULT
[-HEADER=
<table bordercolorlight="#6699CC" bordercolordark="#E1E1E1" class="Label">
<tr class="Label" align=center bgcolor="#6699CC">
<th><font color="white">~Column1</font></th>
<th><font color="white">~Column2</font></th>
</tr>
-]
[- ONEROW =
<tr bgcolor="#F2F2F2" class="Label3" align="center"> <td>~Column1Value</td><td>~Column2value</td>
</tr>
-]
.
.snip, and so on more parameters if needed
.
[- NOTFOUND=
<tr class="Error"><td>There are no entries found.</td></tr> -]
[-FOOTER= </table>-]
+}

This is a single template tag with tag parameters to generate a full html table as you please. In the above example the pascal module only replaces the actual values in the table header and rows (marked by tilde "~").

AB

Reply by email

silvioprog
to Michael Van Canneyt: You can do this for fcgi as well, if you set the port number before the Run statement.…

Em 27-05-2010 11:52, Michael Van Canneyt escreveu: [...]
Requires the use of ExternalCGI feature in Apache, or the new CGI->FastCGI gateway.

Please, do you know any article about it? I need to implement this (FCGI) on my Linux (Ubuntu 10.04).

In this demo:

"..lazarus/components/fpweb/demo/echo"

Only with CGI is Ok, but, if I change:

(...)
program echo;
{$mode objfpc}{$H+}

uses

  fpWeb,fpfcgi {<< here, from fpcgi to fpcgi}, wmecho;

(...)

I receive this tipical error:

----------------------------------------
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster at localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/2.2.14 (Ubuntu) Server at localhost Port 80 ----------------------------------------

:'(

Ps.: To apply fcgi on my apache, I used this tip:

<http://code.google.com/p/extpascal/wiki/GettingStarted>

Silvio Clecio $ programmer ObjectPascal - <http://silvioprog.com.br> $ Acesse nosso canal IRC sobre Lazarus no Brasil - #lazarus-br

Reply by email

silvioprog
to Leonardo M. Ramé: Hi, I want to show a little example of an CGI app I created this weekend using Lazarus…
Leonardo M. Ram? wrote 22 lines
Hi, I want to show a little example of an CGI app I created this weekend using Lazarus with a package called FreeSpider, very similar to fpWeb. It runs on a 512mb of ram Debian i386 server hosted in Argentina in a shared hosting account. The module consists of only two .pas files, one to handle the database connection, using fcl-db (MySql) and the other to handle the CGI requests. In total it required approx. 300 lines of code. Apart from the pascal code, I used four html templates to "draw" the page header and the modules called home (for the first page), search for the "search engine" and "aerodromo" to show the airport data sheet. http://www.aeropuertosarg.com.ar/cgi-bin/aerodromos To use it simply type part of the name of the airport, or city or IATA code. For example type "a" and click "buscar" (search in spanish). For now it only has one airport "Aeroparque de la Ciudad de Buenos Aires", but it will grow in the future. It'll show a list of coincidences, then click on one to see it's data sheet. That's all.

Perfect!

I'll develop for web using FPC-Lazarus+FastCGI also! :)

Silvio Clecio $ programmer ObjectPascal - <http://silvioprog.com.br> $ Acesse nosso canal IRC sobre Lazarus no Brasil - #lazarus-br

Reply by email

Michael Van Canneyt
to Leonardo M. Ramé: El jue, 27-05-2010 a las 22:43 +0200, Michael Van Canneyt escribi?: Well this is a fairly…
Leonardo M. Ram? wrote 16 lines
El jue, 27-05-2010 a las 22:43 +0200, Michael Van Canneyt escribi?: > It would be an interesting test to see how easy you could > re-create that in fcl-web. > > Maybe we can learn something from this test, see how we > can improve and/or simplify things. > > Michael. > Well this is a fairly trivial app, I'm sure I can recreate it in without problems with fpWeb and templates. One interesting part of FreeSpider is that it includes an object oriented way to create HTML tables, this helps to avoid mixing HTML code with Object Pascal when you want to create tables from database data.

fcl-web has this too. see the whtml and dbwhtml units. TTableProducer.

On the other hand, fpWeb has a more advanced templating engine, that maybe (I don't tested it) allows one to create rows of an HTML table right from the template, without creating it inside the program's code.

You would have to combine 2 templates and set a callback.

Michael.

Reply by email

Graeme Geldenhuys
to Felipe Monteiro de Carvalho: Did fpWeb make it to Toolbox or one of the books? I'm getting curious about it... Felipe…
Felipe Monteiro de Carvalho wrote
Did fpWeb make it to Toolbox or one of the books? I'm getting curious about it...

If I am not mistaken, Michael already wrote and article about it in Toolbox. I vaguely remember something like that. Use the January cover DVD (2010-01) which contains all previous articles and do a search.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Joost van der Sluis
to silvioprog: [...] Requires the use of ExternalCGI feature in Apache, or the new CGI->FastCGI gateway.…
silvioprog wrote 47 lines
Em 27-05-2010 11:52, Michael Van Canneyt escreveu: [...] Requires the use of ExternalCGI feature in Apache, or the new CGI->FastCGI gateway. Please, do you know any article about it? I need to implement this (FCGI) on my Linux (Ubuntu 10.04). In this demo: "..lazarus/components/fpweb/demo/echo" Only with CGI is Ok, but, if I change: (...) program echo; {$mode objfpc}{$H+} uses fpWeb,fpfcgi {<< here, from fpcgi to fpcgi}, wmecho; (...) I receive this tipical error: ---------------------------------------- Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster at localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache/2.2.14 (Ubuntu) Server at localhost Port 80 ---------------------------------------- :'( Ps.: To apply fcgi on my apache, I used this tip: <http://code.google.com/p/extpascal/wiki/GettingStarted>

Please, don't do what that link says. Why does everybody do so difficult when then want to use fcgi? It's a common, widely used technology. Even by php.

For example, when you are on fedora, just do 'yum install mod_fpcgid' and it'll work.

So look up how to install fastcgi support on your OS, and do that. Or if you use Apache, look in the Apache documentation. Or the fastcgi documentation.

Joost.

Reply by email

Joost van der Sluis
to Bee Jay: Can we have all of this on the next fpc 2.4.2? -Bee-
Bee Jay wrote 7 lines
On 27 Mei 2010, at 21:52, Michael Van Canneyt wrote: > You can do this for fcgi as well, if you set the port number before > the Run statement. Requires the use of ExternalCGI feature in Apache, or > the new CGI->FastCGI gateway. Can we have all of this on the next fpc 2.4.2?

No, fpWeb is too much under development now. The interface may be changed in the future, so it's not ready for 2.4.2. But this specific part, the gateway, is just an example and can also work with 2.4.0 already. It's nothing new? (Or does is use the new feature to connect to a given port? That feature is merged.)

Joost.

Reply by email

Joost van der Sluis
to silvioprog: I also have much interest. I am studying a way to create applications to run in the…
silvioprog wrote 16 lines
Em 27-05-2010 06:36, Bee Jay escreveu: > Hi all, > > I'm about to study fpWeb and its FCGI support. But I didn't see any example that are using FCGI in SVN trunk. There are only CGIs and Apache modules. Can they be used with FCGI simply by changing the used unit? I also couldn't find any suffiecient docs about the FCGI support. Any hints? > > TIA. > > -Bee- I also have much interest. I am studying a way to create applications to run in the browser. My current study: . Apache+FastCGI+Gateway

Gateway? Why? That's even slower then normal cgi. Because the gateway is in fact an cgi aplication that calls your fastcgi application. Thatn you'd better create a direct cgi-application. (It's one compiler switch away...)

. fpWeb . HTML+CSS+JS If you find any helps (about FCGI + FPC), please share with us.

Fcgi is the same as cgi. Except that the process is started once and not for each call. Nothing special here. (although you have to clean up all stuf for the next request, offcourse. But you should that do for cgi also, if you do it right)

Joost

Reply by email

Joost van der Sluis
to Leonardo M. Ramé: Hi, I want to show a little example of an CGI app I created this weekend using Lazarus…
Leonardo M. Ram? wrote 8 lines
Hi, I want to show a little example of an CGI app I created this weekend using Lazarus with a package called FreeSpider, very similar to fpWeb. It runs on a 512mb of ram Debian i386 server hosted in Argentina in a shared hosting account. The module consists of only two .pas files, one to handle the database connection, using fcl-db (MySql) and the other to handle the CGI requests. In total it required approx. 300 lines of code.

Wow, that's a lot. 300 lines?!? Using fcl-web and webdesign you can do this without any lines of code. Just use the designer.

Joost

Reply by email

Joost van der Sluis
to Leonardo M. Ramé: El jue, 27-05-2010 a las 22:43 +0200, Michael Van Canneyt escribi?: Well this is a fairly…
Leonardo M. Ram? wrote 20 lines
El jue, 27-05-2010 a las 22:43 +0200, Michael Van Canneyt escribi?: > It would be an interesting test to see how easy you could > re-create that in fcl-web. > > Maybe we can learn something from this test, see how we > can improve and/or simplify things. > > Michael. > Well this is a fairly trivial app, I'm sure I can recreate it in without problems with fpWeb and templates. One interesting part of FreeSpider is that it includes an object oriented way to create HTML tables, this helps to avoid mixing HTML code with Object Pascal when you want to create tables from database data. On the other hand, fpWeb has a more advanced templating engine, that maybe (I don't tested it) allows one to create rows of an HTML table right from the template, without creating it inside the program's code.

The webdesign package has a better way to support grids then there is now currently in fcl-web.

But what you want eventually is that the (grid) component has it's own internal format. And that you use a mediator to fill it with data, so that you can connect it to anything you want. Objects, databases, anything.

And anyone can help, it's no rocket science. Cgi is about writeln's after all... ;)

Joost.

Reply by email

Bee Jay
to Joost van der Sluis: Please, don't do what that link says. Why does everybody do so difficult when then want…
Joost van der Sluis wrote
Please, don't do what that link says. Why does everybody do so difficult when then want to use fcgi? It's a common, widely used technology. Even by php.

Well... it seems that not everybody is as smart as you are, Joost. Even many people -yes, there are also programmers- still don't understand how web app work. Let them learn by mistakes. ;)

-Bee-

Reply by email

Bee Jay
to Joost van der Sluis: Gateway? Why? That's even slower then normal cgi. Because the gateway is in fact an cgi…
Joost van der Sluis wrote
Gateway? Why?

There are some situations when gateway could provide a better solution.

That's even slower then normal cgi. Because the gateway is in fact an cgi aplication that calls your fastcgi application.

I believe you already know that speed isn't everything in software development.

Fcgi is the same as cgi. Except that the process is started once and not for each call.

Then, they're different, at least too me. ;)

-Bee-

Reply by email

Michael Van Canneyt
to Joost van der Sluis: The webdesign package has a better way to support grids then there is now currently in…
Joost van der Sluis wrote 24 lines
On Thu, 2010-05-27 at 17:52 -0300, Leonardo M. Ram? wrote: > El jue, 27-05-2010 a las 22:43 +0200, Michael Van Canneyt escribi?: > > It would be an interesting test to see how easy you could > > re-create that in fcl-web. > > > > Maybe we can learn something from this test, see how we > > can improve and/or simplify things. > > > > Michael. > > > > Well this is a fairly trivial app, I'm sure I can recreate it in without > problems with fpWeb and templates. > > One interesting part of FreeSpider is that it includes an object > oriented way to create HTML tables, this helps to avoid mixing HTML code > with Object Pascal when you want to create tables from database data. > > On the other hand, fpWeb has a more advanced templating engine, that > maybe (I don't tested it) allows one to create rows of an HTML table > right from the template, without creating it inside the program's code. The webdesign package has a better way to support grids then there is now currently in fcl-web.

Not since yesterday it hasn't :-)

See webdata. That's exactly what it's for :-)

Michael.>

Reply by email

Joost van der Sluis
to Bee Jay: Well... it seems that not everybody is as smart as you are, Joost. Even many people -yes,…
Bee Jay wrote 7 lines
On 28 Mei 2010, at 15:01, Joost van der Sluis wrote: > Please, don't do what that link says. Why does everybody do so difficult > when then want to use fcgi? It's a common, widely used technology. Even > by php. Well... it seems that not everybody is as smart as you are, Joost. Even many people -yes, there are also programmers- still don't understand how web app work. Let them learn by mistakes. ;)

Yes, offcourse. But the one who wrote it should now better? Besides that I think it should be clear that all fpWeb stuff is under development. There is no documentation, we rush in some examples to help people further.

If you develop web applications, you can use google. Installing fastcgi is nothing special. If you expect that everything is 'ready-to-go', wait until everything is released. Maybe it's not a good idea for someone to start working with web-applications for the first time to work with a brand new, alfa/beta framework.

But I agree that I could be somewhat more cooperative. But I do not always have the time for that.

Joost.

Reply by email

Joost van der Sluis
to Bee Jay: There are some situations when gateway could provide a better solution. I believe you…
Bee Jay wrote 5 lines
On 28 Mei 2010, at 15:10, Joost van der Sluis wrote: > Gateway? Why? There are some situations when gateway could provide a better solution.

Can you name me one?

> That's even slower then normal cgi. Because the gateway is > in fact an cgi aplication that calls your fastcgi application. I believe you already know that speed isn't everything in software development.

Well, according to me there is no reason why you would use fastcgi besides speed. (Caching and startuptimes)

> Fcgi is the same as cgi. Except that the process is started once and not > for each call. Then, they're different, at least too me. ;)

Offcourse they are. But not for the framework.

Joost.

Reply by email

Joost van der Sluis
to Bee Jay: Is it possible to compile them with 2.4.2? So, I could simply copy them somewhere and use…
Bee Jay wrote 6 lines
On 28 Mei 2010, at 15:07, Joost van der Sluis wrote: > fpWeb is too much under development now. The interface may be > changed in the future, so it's not ready for 2.4.2. Is it possible to compile them with 2.4.2? So, I could simply copy them somewhere and use them with 2.4.2.

Yes, just copy the fcl-web from trunk over the one in fixes. When 2.4.2 is released we can also provide a fppkg package for that.

Joost.

Reply by email

Bee Jay
to Joost van der Sluis: Can you name me one? Well, according to me there is no reason why you would use fastcgi…
Joost van der Sluis wrote
Can you name me one?

On hosting that only support CGI but not FCGI.

Well, according to me there is no reason why you would use fastcgi besides speed. (Caching and startuptimes)

Yes. I meant the CGI gateway solution, I knew it's not that fast, but I need it on some circumstances. Everyone need may vary though.

Offcourse they are. But not for the framework.

I see. BTW... thanks fcl-web package.

-Bee-

Reply by email

Joost van der Sluis
to Bee Jay: On hosting that only support CGI but not FCGI. Yes. I meant the CGI gateway solution, I…
Bee Jay wrote 5 lines
On 28 Mei 2010, at 16:33, Joost van der Sluis wrote: > Can you name me one? On hosting that only support CGI but not FCGI.

But they allow you to run a separate application as a daemon? Strange... Or do you forward requests to another host?

> Well, according to me there is no reason why you would use fastcgi > besides speed. (Caching and startuptimes) Yes. I meant the CGI gateway solution, I knew it's not that fast, but I need it on some circumstances. Everyone need may vary though.

Offcourse, but I saw the gateway and was wondering why someone wanted to use that.

Joost.

Reply by email

Michael Van Canneyt
to Joost van der Sluis
Joost van der Sluis wrote 9 lines
On Fri, 2010-05-28 at 16:37 +0700, Bee Jay wrote: > On 28 Mei 2010, at 16:33, Joost van der Sluis wrote: > >> Can you name me one? > > On hosting that only support CGI but not FCGI. But they allow you to run a separate application as a daemon? Strange... Or do you forward requests to another host?

This is one of the options in the gateway, and actually one of the useful aspects of it.

A webserver can also simply forward requests, but then you need access to the webserver configuration. The gateway solves this problem.

Michael.

Reply by email

Michael Schnell
to Bee Jay: I'm about to study fpWeb and its FCGI support. But I didn't see any example that are…
Bee Jay wrote
I'm about to study fpWeb and its FCGI support. But I didn't see any example that are using FCGI in SVN trunk. There are only CGIs and Apache modules. Can they be used with FCGI simply by changing the used unit? I also couldn't find any suffiecient docs about the FCGI support. Any hints?

On top of FCGI it makes a lot sense to have Comet, too. (Fast showing of asynchronous server events on the web client without extensive polling.)

Are there any examples regarding that ?

-Michael

Reply by email

Leonardo M. Ramé
to Joost van der Sluis: The webdesign package has a better way to support grids then there is now currently in…

El vie, 28-05-2010 a las 10:22 +0200, Joost van der Sluis escribi?:

Show quoted text 35 lines
On Thu, 2010-05-27 at 17:52 -0300, Leonardo M. Ram? wrote: > El jue, 27-05-2010 a las 22:43 +0200, Michael Van Canneyt escribi?: > > It would be an interesting test to see how easy you could > > re-create that in fcl-web. > > > > Maybe we can learn something from this test, see how we > > can improve and/or simplify things. > > > > Michael. > > > > Well this is a fairly trivial app, I'm sure I can recreate it in without > problems with fpWeb and templates. > > One interesting part of FreeSpider is that it includes an object > oriented way to create HTML tables, this helps to avoid mixing HTML code > with Object Pascal when you want to create tables from database data. > > On the other hand, fpWeb has a more advanced templating engine, that > maybe (I don't tested it) allows one to create rows of an HTML table > right from the template, without creating it inside the program's code. The webdesign package has a better way to support grids then there is now currently in fcl-web. But what you want eventually is that the (grid) component has it's own internal format. And that you use a mediator to fill it with data, so that you can connect it to anything you want. Objects, databases, anything. And anyone can help, it's no rocket science. Cgi is about writeln's after all... ;) Joost.

Joost, the 300 lines are Object Pascal code, I'll try to reproduce the same result using fpWeb this weekend, hopefully I can make it with less code, then I'll show you it so you can make recommendations to let me optimize it.

For the HTML/JS/CSS side, I don't use any designer, just a text editor. Anyway, I'll take a look at the webdesign package.

Leonardo M. Ram? Griensu S.A. - Medical IT C?rdoba Tel.: 0351-4247979

Reply by email

silvioprog
to Joost van der Sluis: Please, don't do what that link says. Why does everybody do so difficult when then want…
Joost van der Sluis wrote 6 lines
Please, don't do what that link says. Why does everybody do so difficult when then want to use fcgi? It's a common, widely used technology. Even by php. For example, when you are on fedora, just do 'yum install mod_fpcgid' and it'll work.

Thanks Joost, after your tip I managed to install by Synaptic, please, see:

<http://imagebin.org/98780>

But unfortunately I still can not run the demos of "...lazarus/components/fpweb" on my Ubuntu Linux, I receive that same error that I showed in another email. :(

But I have something positive to talk about in the next email ...

Show quoted text 5 lines
So look up how to install fastcgi support on your OS, and do that. Or if you use Apache, look in the Apache documentation. Or the fastcgi documentation. Joost.
Silvio Clecio $ programmer ObjectPascal - <http://silvioprog.com.br> $ Acesse nosso canal IRC sobre Lazarus no Brasil - #lazarus-br

Reply by email

silvioprog
to Joost van der Sluis: Gateway? Why? That's even slower then normal cgi. Because the gateway is in fact an cgi…

Em 28-05-2010 05:10, Joost van der Sluis escreveu: [...]

Fcgi is the same as cgi. Except that the process is started once and not for each call. Nothing special here. (although you have to clean up all stuf for the next request, offcourse. But you should that do for cgi also, if you do it right)

Wow, it makes me very happy, because I can run CGI pure smoothly on my Ubuntu. :)

A simple sample that works em my PC:

$ sudo ln -s mycgi /usr/lib/cgi-bin

After:

http://localhost/cgi-bin/mycgi

This is works perfectely :)

Thanks again guy ;)

Joost
Silvio Clecio $ programmer ObjectPascal - <http://silvioprog.com.br> $ Acesse nosso canal IRC sobre Lazarus no Brasil - #lazarus-br

Reply by email

silvioprog
to Joost van der Sluis: Yes, just copy the fcl-web from trunk over the one in fixes. When 2.4.2 is released we…
Joost van der Sluis wrote 12 lines
On Fri, 2010-05-28 at 16:17 +0700, Bee Jay wrote: > On 28 Mei 2010, at 15:07, Joost van der Sluis wrote: > >> fpWeb is too much under development now. The interface may be >> changed in the future, so it's not ready for 2.4.2. > > Is it possible to compile them with 2.4.2? So, I could simply copy them somewhere and use them with 2.4.2. Yes, just copy the fcl-web from trunk over the one in fixes. When 2.4.2 is released we can also provide a fppkg package for that. Joost.

I'm interested in this also, because the moment I am using the FPC-2.4.0.

Silvio Clecio $ programmer ObjectPascal - <http://silvioprog.com.br> $ Acesse nosso canal IRC sobre Lazarus no Brasil - #lazarus-br

Reply by email

Bee Jay
to Joost van der Sluis: But they allow you to run a separate application as a daemon? Strange... Or do you…
Joost van der Sluis wrote
But they allow you to run a separate application as a daemon? Strange...

That's why I asked for autoshutdown feature in another mail in the other list (since it's not about lazarus).

Or do you forward requests to another host?

Yes, that's another useful advantage of CGI gateway.

Offcourse, but I saw the gateway and was wondering why someone wanted to use that.

I've been using it. :)

-Bee-

Reply by email