REQ: official FPC's FCGI framework

classic Classic list List threaded Threaded
25 messages Options
12
Reply | Threaded
Open this post in threaded view
|

REQ: official FPC's FCGI framework

Bee-6
Hi all,

FPC has pretty usable support for web based development. Currently FPC
supports it through CGI and Apache module. IMO, there's one more support
that should be added officially: FastCGI. The initial work has been done
by ExtPascal project. But, somehow I found it a bit problematic if it's
compiled by FPC on non-Windows platform, especially with thread-related.

Hence, I now request for official support from FPC to provide FCGI
framework as the third alternative for web based application
development. Later, this official framework could be used as alternative
FCGI framework for ExtPascal project.

What do you think? TIA.

-Bee-
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Michael Van Canneyt


On Wed, 11 Feb 2009, Bee wrote:

> Hi all,
>
> FPC has pretty usable support for web based development. Currently FPC
> supports it through CGI and Apache module. IMO, there's one more support that
> should be added officially: FastCGI. The initial work has been done by
> ExtPascal project. But, somehow I found it a bit problematic if it's compiled
> by FPC on non-Windows platform, especially with thread-related.
>
> Hence, I now request for official support from FPC to provide FCGI framework
> as the third alternative for web based application development. Later, this
> official framework could be used as alternative FCGI framework for ExtPascal
> project.
>
> What do you think? TIA.

I see no reason why this could not be done. Will you coordinate the efforts?

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Bee-6
> I see no reason why this could not be done. Will you coordinate the efforts?

I'd like to help, especially on testing and bug fixing. But I don't
think I have enough knowledge about threading and FCGI internal work. I
need people who have the expertise on those 2 fields to do the initial
work. ExtPascal author (Wanderlan) doesn't seem very interested to
support non Windows platform as he mostly works on Windows (using Delphi).

I'm also quite active in ExtPascal project though mostly on testing and
bug fixing but I don't do much on the real coding work. Some enhancement
suggestions are also came as my request (CGI gateway, Mac support,
enumeration, etc). I can help on the same things here.

-Bee-
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Bee-6
In reply to this post by Bee-6
http://cryp.to/publications/fastcgi/

I found the article shows very good reasons why we should start to work
in or support FCGI instead of plain CGI. ;) While I'm using ExtPascal's
FCGI, I can debug my FCGI app (using Lazarus) as if it's a normal
desktop application. Something that I couldn't do when using Powtils. :)

-Bee-
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Graeme Geldenhuys-2
On Thu, Feb 12, 2009 at 9:35 AM, Bee <[hidden email]> wrote:
> can debug my FCGI app (using Lazarus) as if it's a normal desktop
> application. Something that I couldn't do when using Powtils. :)

That sounds very handy!!!  I also use Powtils for our CGI
applications.  What is the actual difference between FastCGI and CGI?
Does FastCGI also work under most web servers?


Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Bee-6
> That sounds very handy!!!  I also use Powtils for our CGI
> applications.  What is the actual difference between FastCGI and CGI?

You may find all the differences within the article I posted above. But
the most wonderful thing is FCGI lives forever since it's a separate
application apart from the web server (which acts as an FCGI client).

> Does FastCGI also work under most web servers?

FastCGI is indeed a forgotten treasure. It's not a new technology
actually, most common web servers had supported it already though
disabled by default (or requires additional installation). Since SAAS
with very high load hits become common nowadays, people are starting to
look at this technology, which IMO is very scalable. That's why some web
frameworks/applications requires it (Ruby? Django?).

If your web server doesn't support FCGI, ExtPascal has a CGI-to-FCGI
gateway that redirect a CGI request to an FCGI service independently (as
long as web server supports CGI protocol).

-Bee-

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Graeme Geldenhuys-2
On Thu, Feb 12, 2009 at 11:02 AM, Bee <[hidden email]> wrote:
>
> You may find all the differences within the article I posted above. But the
> most wonderful thing is FCGI lives forever since it's a separate application
> apart from the web server (which acts as an FCGI client).

I replied before I read the article. Yes the article explains the
differences and reason well. Thanks.
I'm very keen to try FastCGI now, because database connections are the
exact issue I have in standard CGI apps. And no, I am not in favour of
going for Apache Modules as they are Apache version specific as far as
I understand.

At the moment our standard CGI apps have to do exactly what the
article says: read config files, parse session variables, establish a
new DB connection, build the new page and quit.  So far we have good
performance as I am very specific with what I retrieve from the
database and what goes into the HTML page, but we haven't tested our
product on a heavier load.


> FastCGI is indeed a forgotten treasure. It's not a new technology actually,
> most common web servers had supported it already though disabled by default
> (or requires additional installation).

We have a controlled deployment base and currently use Apache 2 under
Linux and Windows. But looking on my local development machine, my
Apache 2 only has modules for standard CGI (mod_cgi.so) and not
FastCGI. :-(   I'm using Ubuntu 7.10.


Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Michael Van Canneyt


On Thu, 12 Feb 2009, Graeme Geldenhuys wrote:

> On Thu, Feb 12, 2009 at 11:02 AM, Bee <[hidden email]> wrote:
> >
> > You may find all the differences within the article I posted above. But the
> > most wonderful thing is FCGI lives forever since it's a separate application
> > apart from the web server (which acts as an FCGI client).
>
> I replied before I read the article. Yes the article explains the
> differences and reason well. Thanks.
> I'm very keen to try FastCGI now, because database connections are the
> exact issue I have in standard CGI apps. And no, I am not in favour of
> going for Apache Modules as they are Apache version specific as far as
> I understand.
>
> At the moment our standard CGI apps have to do exactly what the
> article says: read config files, parse session variables, establish a
> new DB connection, build the new page and quit.  So far we have good
> performance as I am very specific with what I retrieve from the
> database and what goes into the HTML page, but we haven't tested our
> product on a heavier load.
>
>
> > FastCGI is indeed a forgotten treasure. It's not a new technology actually,
> > most common web servers had supported it already though disabled by default
> > (or requires additional installation).
>
> We have a controlled deployment base and currently use Apache 2 under
> Linux and Windows. But looking on my local development machine, my
> Apache 2 only has modules for standard CGI (mod_cgi.so) and not
> FastCGI. :-(   I'm using Ubuntu 7.10.

I think any normal apache supports fastcgi out of the box ? Probably you
just need to install another package?

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Graeme Geldenhuys-2
On Thu, Feb 12, 2009 at 11:27 AM, Michael Van Canneyt
<[hidden email]> wrote:
>
> I think any normal apache supports fastcgi out of the box ? Probably you
> just need to install another package?


It wasn't as part of the default available modules, but a quick search
in the apt repository revealed that I needed to install
"libapache2-mod-fastcgi" package.  Problem is now solved. :-)


Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Bee-6
In reply to this post by Graeme Geldenhuys-2
> We have a controlled deployment base and currently use Apache 2 under
> Linux and Windows. But looking on my local development machine, my
> Apache 2 only has modules for standard CGI (mod_cgi.so) and not
> FastCGI. :-(   I'm using Ubuntu 7.10.

If you need native FCGI support from the web server, you may start from
here: http://code.google.com/p/extpascal/wiki/GettingStarted and read
the "Setting using native FastCGI, only for Apache 2.2+" section on the
bottom.

If you don't need native FCGI support, you may read the "Setting using
FastCGI thru CGI gateway (any Apache version and similar procedure on
IIS)" section on the same article above.

Personally, I prefer the later because I have better control over the
CGI gateway and the FCGI service. Especially during development, you
don't want to restart your web server each time you recompile and rerun
your program. ;)

-Bee-
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Micha Nelissen
In reply to this post by Bee-6
Bee wrote:
> Hi all,
>
> FPC has pretty usable support for web based development. Currently FPC
> supports it through CGI and Apache module. IMO, there's one more support
> that should be added officially: FastCGI. The initial work has been done

lNet has fastcgi support. Maybe it's interesting for you. It can connect
to some server or spawn some itself. Implemented in lib/lfastcgi.pp.

It's used by lwebserver to provide a fastcgi connection to PHP backend.
In lib/lwebserver.pp.

Micha
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Bee-6
> lNet has fastcgi support. Maybe it's interesting for you. It can connect
> to some server or spawn some itself. Implemented in lib/lfastcgi.pp.

I didn't know about this. I'll take a look at it. Anyway, what I need is
*official* FCGI package from FPC as CGI and Apache module.

-Bee-
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Michael Van Canneyt


On Fri, 13 Feb 2009, Bee wrote:

> > lNet has fastcgi support. Maybe it's interesting for you. It can connect to
> > some server or spawn some itself. Implemented in lib/lfastcgi.pp.
>
> I didn't know about this. I'll take a look at it. Anyway, what I need is
> *official* FCGI package from FPC as CGI and Apache module.

You indicated that some kind of fastcgi thing already exists for (free)
pascal. Hereby I *officially* request that YOU coordinate efforts to get
it integrated in FPC.

I can do some of the work (the gory programming details), but not all.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Bee-6
> You indicated that some kind of fastcgi thing already exists for
> (free) pascal.

So far, I only knew ExtPascal's FCGI. Just now, I knew that lNet had it
too, though I still didn't know yet the details.

> Hereby I *officially* request that YOU coordinate efforts to get it
> integrated in FPC.

Alright then. I got ExtPascal FCGI code though I'm not quite sure I
understand it comprehensively, but I'd like to try. Then what effort I
need to do to integrate it in FPC?

> I can do some of the work (the gory programming details), but not
> all.

The most important support I need is to stabilize the ExtPascal's FCGI
thread mechanism in all platforms, especially on non-Windows platforms.
Though it works now, but I still found some problems and the current
workaround looks hackish rather than elegant solution. While on the
other side, I'm not quite an expert on FCGI and multithread programming
(especially on non-Windows platforms) to confidently propose alternative
solutions.

I also suspect that ExtPascal's current implemented multithread
mechanism doesn't fit well on non-Windows platform. Maybe it's because
the initial design is too Windows oriented. Multiplatform support added
later through FPC (more or less because of my request). I'd be very
grateful if there's someone who has expertise on UNIX multithread
programming would like to analyze the ExtPascal's FCGI code. :)

Thanks for the support and encouragement, Michael. I appreciate it. :)
BTW, it'd be nice if Morfik also supports FCGI. ;)

-Bee-
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Michael Van Canneyt


On Fri, 13 Feb 2009, Bee wrote:

> > You indicated that some kind of fastcgi thing already exists for
> > (free) pascal.
>
> So far, I only knew ExtPascal's FCGI. Just now, I knew that lNet had it too,
> though I still didn't know yet the details.
>
> > Hereby I *officially* request that YOU coordinate efforts to get it
> > integrated in FPC.
>
> Alright then. I got ExtPascal FCGI code though I'm not quite sure I understand
> it comprehensively, but I'd like to try. Then what effort I need to do to
> integrate it in FPC?
>
> > I can do some of the work (the gory programming details), but not
> > all.
>
> The most important support I need is to stabilize the ExtPascal's FCGI thread
> mechanism in all platforms, especially on non-Windows platforms. Though it
> works now, but I still found some problems and the current workaround looks
> hackish rather than elegant solution. While on the other side, I'm not quite
> an expert on FCGI and multithread programming (especially on non-Windows
> platforms) to confidently propose alternative solutions.
>
> I also suspect that ExtPascal's current implemented multithread mechanism
> doesn't fit well on non-Windows platform. Maybe it's because the initial
> design is too Windows oriented. Multiplatform support added later through FPC
> (more or less because of my request). I'd be very grateful if there's someone
> who has expertise on UNIX multithread programming would like to analyze the
> ExtPascal's FCGI code. :)

If you send me the relevant units, I'll have a look.

>
> Thanks for the support and encouragement, Michael. I appreciate it. :) BTW,
> it'd be nice if Morfik also supports FCGI. ;)

Feel free to request it there and refer them to me ;-)

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Bee-6
> If you send me the relevant units, I'll have a look.

You could get the FCGIApp.pas from
http://code.google.com/p/extpascal/source/browse/#svn/trunk

Our discussion brought us to:
http://bugs.freepascal.org/view.php?id=9016
http://bugs.freepascal.org/view.php?id=10815

> Feel free to request it there and refer them to me ;-)

Unfortunately, I can't request it for free anymore. ;-)

-Bee-
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Michael Van Canneyt


On Fri, 13 Feb 2009, Bee wrote:

> > If you send me the relevant units, I'll have a look.
>
> You could get the FCGIApp.pas from
> http://code.google.com/p/extpascal/source/browse/#svn/trunk
>
> Our discussion brought us to:
> http://bugs.freepascal.org/view.php?id=9016
> http://bugs.freepascal.org/view.php?id=10815

I'll have a look during the weekend.

>
> > Feel free to request it there and refer them to me ;-)
>
> Unfortunately, I can't request it for free anymore. ;-)

Nope. I had to buy Morfik too. luckily they lowered their prices
significantly.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Bee-6
> I'll have a look during the weekend.

Thank you very much, Michael. :)

> Nope. I had to buy Morfik too. luckily they lowered their prices
> significantly.

Does purchasing include Developer Assist support?

-Bee-
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Michael Van Canneyt


On Fri, 13 Feb 2009, Bee wrote:

> > I'll have a look during the weekend.
>
> Thank you very much, Michael. :)
>
> > Nope. I had to buy Morfik too. luckily they lowered their prices
> > significantly.
>
> Does purchasing include Developer Assist support?

No, you have to pay extra, but at least if you purchased it, you get
a reply to a mail.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: REQ: official FPC's FCGI framework

Jonas Maebe-2
In reply to this post by Bee-6

On 13 Feb 2009, at 14:09, Bee wrote:

> Our discussion brought us to:
> http://bugs.freepascal.org/view.php?id=9016
> http://bugs.freepascal.org/view.php?id=10815

What about those bugs? Both are fixed/closed.


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
12