Sign in Join

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

Mailing lists / lazarus / 2010-05

WebLaz Apache

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Lee Jenkins

OK, since everyone's talking about the web technologies in Laz/FPC lately, I have a question. Anyone currently running web site/app with WebLaz Apache module flavor. Any high traffic?

I'm using a stand alone synapse based HTTP server now for testing, but I want to deploy eventually to apache via WebLaz.

Warm Regards, Lee

Reply by email

ABorka
to Lee Jenkins

Did. But in the current economy the traffic is down, and because of CGI doesn't require an Apache restart when anything changes in the app, we are just using CGI at the moment (with HTML templates and template tags using fpTemplate). Did not see speed difference between the two. However, any time the need arises, we can just recompile the app as an Apache module in minutes and us that.
The web module source code is exactly the same for CGI programs and Apache mods, so no changes needed for the

Lee Jenkins wrote 20 lines
OK, since everyone's talking about the web technologies in Laz/FPC lately, I have a question. Anyone currently running web site/app with WebLaz Apache module flavor. Any high traffic? I'm using a stand alone synapse based HTTP server now for testing, but I want to deploy eventually to apache via WebLaz. -- Warm Regards, Lee -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Lee Jenkins
to ABorka
ABorka wrote 11 lines
Did. But in the current economy the traffic is down, and because of CGI doesn't require an Apache restart when anything changes in the app, we are just using CGI at the moment (with HTML templates and template tags using fpTemplate). Did not see speed difference between the two. However, any time the need arises, we can just recompile the app as an Apache module in minutes and us that. The web module source code is exactly the same for CGI programs and Apache mods, so no changes needed for the recompile at all. AB

Ah, I need pooling and richer session support than CGI offers so its Apache, FastCGI for me.

Thanks for the info however!

Warm Regards, Lee

Reply by email

Marcos Douglas
to ABorka: Did. But in the current economy the traffic is down, and because of CGI doesn't require…
ABorka wrote 5 lines
(...) However, any time the need arises, we can just recompile the app as an Apache module in minutes and us that. The web module source code is exactly the same for CGI programs and Apache mods, so no changes needed for the changes to transform CGI code in Apache_mod?

Well, I never coded an Apache_mod, but I think it would be multi-thread, right? Your code is like that?
Can you talk more about?

Marcos Douglas

Reply by email

ABorka
to Marcos Douglas
Marcos Douglas wrote 13 lines
> (...) > However, any time the need arises, we can just recompile the app as an > Apache module in minutes and us that. > The web module source code is exactly the same for CGI programs and Apache > mods, so no changes needed for the recompile at all. No changes to transform CGI code in Apache_mod? Well, I never coded an Apache_mod, but I think it would be multi-thread, right? Your code is like that? Can you talk more about? Marcos Douglas

We write all code as if it were an Apache module (or FCGI), even if we compile it as CGI at the moment.
You just need to take care of the fact that web modules already in the memory can be reused for following requests (in case of Apache mods and FCGI), so the global variables, web module variables (private and public), etc. can have values left over from previous requests. Especially, need to take care of closing connections, files, free used memory, etc. after a request is finished and put back things to the initial state before leaving, so the next request that might get the same web module for action handling will find the same state as the previous.
This is the same for Apache modules and FCGI.

Only the .lpi and .lpr files (they are all very small and after creating them the first time no changes are needed at all) are different between Apache module, FCGI and CGI applications, the web module file is the same (example: under your Lazarus directory in
/components/fpweb/demo/fptemplate/sessions/urlsessions-login/).

AB

Reply by email

Marcos Douglas
to ABorka
ABorka wrote 18 lines
We write all code as if it were an Apache module (or FCGI), even if we compile it as CGI at the moment. You just need to take care of the fact that web modules already in the memory can be reused for following requests (in case of Apache mods and FCGI), so the global variables, web module variables (private and public), etc. can have values left over from previous requests. Especially, need to take care of closing connections, files, free used memory, etc. after a request is finished and put back things to the initial state before leaving, so the next request that might get the same web module for action handling will find the same state as the previous. This is the same for Apache modules and FCGI. Only the .lpi and .lpr files (they are all very small and after creating them the first time no changes are needed at all) are different between Apache module, FCGI and CGI applications, the web module file is the same (example: under your Lazarus directory in /components/fpweb/demo/fptemplate/sessions/urlsessions-login/).

Very interesting. For app FCGI, what approach do you use? e.g. multi-thread, lock/unlock, etc.

Marcos Douglas

Reply by email