Sign in Join

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

Mailing lists / fpc-devel / 2006-07

Apache modules?

6 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi,

I am new to web applications. How does Apache Modules differ from CGI apps?

CGI Apps:
* The application executes, creates output and exits.
* Nothing stays in memory between user input

Apache Modules:
* no idea?
* Can things be kept in memory between user input? example: When retrieving data from a database, can the connection be kept open?
* can I load user data (example: login data) and keep in available while the user is working inside the web app?

Is there a good resource on the web explaining the differences? Any help would be great.

Regards,
Graeme.

There's no place like 127.0.0.1

Reply by email

ik
to Graeme Geldenhuys
Graeme Geldenhuys wrote 10 lines
Hi, I am new to web applications. How does Apache Modules differ from CGI apps? CGI Apps: * The application executes, creates output and exits. * Nothing stays in memory between user input Apache Modules: * no idea?

* You can create a pure cgi program that will stay resident in memory (mod_per/python as examples), but you can create extensions and additional things for Apache itself, such as header manipulation (that's what mod_security does) or handling of gzip parameters and much more.

* Can things be kept in memory between user input? example: When retrieving data from a database, can the connection be kept open?

* Yes you can. But the hard question is how would you do it ? how can I know what I should give to specific connection ? if I have 2 communication from the same user, how can I find the difference ? but basically you can.
The thing is that you are getting a sub process that keep execute itself, rather then open a new child, execute things, close the child and any other connection. Here things keep on running until you will stop apache.

* can I load user data (example: login data) and keep in available while the user is working inside the web app?

* a bad security idea (memory leaks, shard memory, virtual host issues etc... )sometimes jails are not that helpful.

Is there a good resource on the web explaining the differences? Any help would be great.

Think about plugins vs content ... plugins are not just for web application development, but sometimes for the server itself (most of the time that is), while content, like cgi, just generate data on demand.

Regards, Graeme.

Ido

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys: I am new to web applications. How does Apache Modules differ from CGI apps? CGI Apps: *…
Graeme Geldenhuys wrote 10 lines
Hi, I am new to web applications. How does Apache Modules differ from CGI apps? CGI Apps: * The application executes, creates output and exits. * Nothing stays in memory between user input Apache Modules: * no idea?

Apache loads your module, initializes it, and then, per page request, calls a couple of event handlers.

The module is only unloaded when apache is unloaded.

* Can things be kept in memory between user input? example: When retrieving data from a database, can the connection be kept open?

Yes, this can be done in the initialization.

* can I load user data (example: login data) and keep in available while the user is working inside the web app?

Yes. It's kept as long as the module is not unloaded. (i.e. till apache is restarted)

Michael.

Reply by email

Felipe Monteiro de Carvalho
to Graeme Geldenhuys: I am new to web applications. How does Apache Modules differ from CGI apps? CGI Apps: *…
Graeme Geldenhuys wrote
Is there a good resource on the web explaining the differences? Any help would be great.

There is a table that compares various web technologies here:

http://162.105.203.19/apache-doc/8.htm#BIN21

Apache modules fit into the "Server API" category.

Acctually you may want to read the full chapter. It´s the first chapter here:

http://162.105.203.19/apache-doc/1.htm

* Can things be kept in memory between user input? example: When retrieving data from a database, can the connection be kept open?

Yes, sure. The module never unloads. You can even open the connect on the initialization of the library, and close on the finalization. Just make sure to handle errors, and possible server crashes.

* can I load user data (example: login data) and keep in available while the user is working inside the web app?

Yes, sure.

You do can use modules to develop web page, but you can also do a lot more with them. One module I am planning to convert can detect spelling errors of a user trying to access a webpage, and then do it´s best to correct them. With modules you have access to all internals of the web server.

Felipe Monteiro de Carvalho

Reply by email

Graeme Geldenhuys
to Felipe Monteiro de Carvalho

Thanks everybody you taking the time to reply... It seems Apache Modules can do a lot more that I thought. Well worth reading a bit more about it!

Regards,
Graeme.

Felipe Monteiro de Carvalho wrote 38 lines
On 7/18/06, Graeme Geldenhuys wrote: > Is there a good resource on the web explaining the differences? Any > help would be great. There is a table that compares various web technologies here: http://162.105.203.19/apache-doc/8.htm#BIN21 Apache modules fit into the "Server API" category. Acctually you may want to read the full chapter. It´s the first chapter here: http://162.105.203.19/apache-doc/1.htm > * Can things be kept in memory between user input? example: When > retrieving data from a database, can the connection be kept open? Yes, sure. The module never unloads. You can even open the connect on the initialization of the library, and close on the finalization. Just make sure to handle errors, and possible server crashes. > * can I load user data (example: login data) and keep in available > while the user is working inside the web app? Yes, sure. You do can use modules to develop web page, but you can also do a lot more with them. One module I am planning to convert can detect spelling errors of a user trying to access a webpage, and then do it´s best to correct them. With modules you have access to all internals of the web server. -- Felipe Monteiro de Carvalho _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel
There's no place like 127.0.0.1

Reply by email

Felipe Monteiro de Carvalho
to Graeme Geldenhuys

Hello,

Maybe we should put a news notice on FPC website that people can now create apache modules with it, with a link to the wiki page of the bindings.

Who is responsible for putting news on the fpc website?

thanks,

Felipe Monteiro de Carvalho

Reply by email