Re: [fpc-pascal] FCL-WEB and PostgreSQL Support: Current Status

2017-09-28 Thread Daniel Gaspary
On Thu, Sep 28, 2017 at 6:11 PM, Michael Van Canneyt
 wrote:
> 1. You can perfectly start the fastcgi in the debugger if you use proxy
> server
> or if you use mod_fastcgi confgured with fastcgiexternalserver configuration
> setting. I believe nginx only uses the proxy mechanism.

Nice to know about this configuration. It seens similar to what I was
imagining, using unix sockets(optionally)

> 2. If that is not an option, there is also the following:
> FPC contains a cgi to fastcgi request converter, you can use that to debug
> the fastcgi by running it inside the debugger, and let apache forward the
> request using the cgi bridge.

Could you elaborate about this bridge? Is some apache/nginx
configuration, an external tool, using some apache mod.. ??

> 3. Third option:
>FCL-Web is transparant in the sense that the code for CGI/FastCGI/Apache
>module or standalone HTTP server is 100% the same. Only the used
>TCustomApplication descendent differs for these 4 environments.
>
> That means you can debug your code using the HTTP server, and switch to
> using FastCGI in production. I use an {$IFDEF } in the project file to
> switch the hosting environment. For the business code this is transparant.

This and the first appear to be the simpler options.

>> Any chance of extend the component / create a new one, with support to
>> receive and send data ?
>
> No. I don't see the need. See above, there are plenty of mechanisms to debug
> a web environment.

I mean .. Not just for this case, but to have a more capable IPC.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FCL-WEB and PostgreSQL Support: Current Status

2017-09-28 Thread Michael Van Canneyt



On Thu, 28 Sep 2017, Daniel Gaspary wrote:


On Wed, Sep 27, 2017 at 12:53 PM, Michael Van Canneyt
 wrote:


Apache, indeed using FastCGI. Used both mod_fastcgi as mod_fcgid. mod_proxy
should work as well.


What do you use to debug this environment, just log messages / log server..?


See below.



Sometime ago I have seen someone mentioned developing with a separated
application which communicated to the cgi / fastcgi part. This Cgi /
fastcgi part was used just to receive / response requests from / to
the web server. This way the debugging became much easier.

My question: How this application communicate with the Cgi / FastCgi part?


You don't need that at all, that is way too complicated.

You have 3 options to debug:

1. You can perfectly start the fastcgi in the debugger if you use proxy server
or if you use mod_fastcgi confgured with fastcgiexternalserver configuration
setting. I believe nginx only uses the proxy mechanism.

2. If that is not an option, there is also the following:
FPC contains a cgi to fastcgi request converter, you can use that to debug
the fastcgi by running it inside the debugger, and let apache forward the
request using the cgi bridge.

3. Third option:
   FCL-Web is transparant in the sense that the code for CGI/FastCGI/Apache
   module or standalone HTTP server is 100% the same. Only the used
   TCustomApplication descendent differs for these 4 environments.

That means you can debug your code using the HTTP server, and switch to
using FastCGI in production. I use an {$IFDEF } in the project file to
switch the hosting environment. For the business code this is transparant.



TSimpleIpc seens to only communicate one way. Anyone using two
TSimpeIpc's components to simulate a duplex channel?

Any chance of extend the component / create a new one, with support to
receive and send data ?


No. I don't see the need. 
See above, there are plenty of mechanisms to debug a web environment.


Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FCL-WEB and PostgreSQL Support: Current Status

2017-09-28 Thread Daniel Gaspary
On Wed, Sep 27, 2017 at 12:53 PM, Michael Van Canneyt
 wrote:

> Apache, indeed using FastCGI. Used both mod_fastcgi as mod_fcgid. mod_proxy
> should work as well.

What do you use to debug this environment, just log messages / log server..?

Sometime ago I have seen someone mentioned developing with a separated
application which communicated to the cgi / fastcgi part. This Cgi /
fastcgi part was used just to receive / response requests from / to
the web server. This way the debugging became much easier.

My question: How this application communicate with the Cgi / FastCgi part?

TSimpleIpc seens to only communicate one way. Anyone using two
TSimpeIpc's components to simulate a duplex channel?

Any chance of extend the component / create a new one, with support to
receive and send data ?

Are you using Sockets(Ip not unix sockets, like SimpleIpc)? I would
like to avoid that, because of firewall restrictions to open a server
socket
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal