Welcome to WebmasterWorld Guest from 18.207.238.169

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

Apache capability similar to Windows IIS Extensions?

FastCGI, IIS Extensions

     
11:43 pm on Jun 2, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:May 22, 2008
posts:92
votes: 0


I have developed a number of web application as cgi executables in C++. Over the last year, I began creating my web apps as IIS extensions which are tens if not hundred times much more efficient since a single process handles all http requests.

Brief ISAPI overview:

In Windows IIS, you can build a web application as a dynamic link library (dll). This is much more efficient than building the web application as an executable (exe) because an IIS extension (dll) is loaded only ONE TIME by IIS. New processes are not created for each http request.

Brief CGI (under Windows) overview:

An exe is launched and terminated with each http request and this is very expensive in terms of CPU use.

Using the extension model, you can do things that you otherwise couldn't. One example would be to track your sessions in RAM as opposed to a database. But more importantly you could do things that you couldn't do under a CGI model. For example, at startup, an IIS extension can load a huge array (let's say 20 MB) of information into RAM only once; let's assume that this is an IP address database for countries and cities. The array of info could be very efficiently used by the web application for every single http request--no db overhead required.

If you were to do this using the cgi model, the exe would be reading the file from ram for each request which would simply be out of the question! The cgi solution for this would be to perform a database lookup.

I have briefly read about FastCGI yet I would really like to know if there are other options to look at before I begin working with Linux and Apache.

Does Apache allow you to load web applications as extension libraries like IIS does? If so, is this commonly done?

Best regards,

Jason

P.S. I don't want to be locked into Windows anymore.

4:13 am on June 4, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:May 22, 2008
posts:92
votes: 0


I really was looking forward to migrating to Apache but it seems that Apache API web application extensions and filters is not a supported feature.

I know that I'm going to have to download linux and apache at some point and start experimenting.

Let me just ask if I were to create an Apache module in C, could that module be written as a library or does Apache have to be completely rebuilt?

1:00 pm on June 4, 2009 (gmt 0)

Full Member

10+ Year Member

joined:Dec 20, 2004
posts:330
votes: 0


Let me just ask if I were to create an Apache module in C,

Well, a module loaded as a dynamic shared object (DSO) is nothing more than an extension library.

If so, is this commonly done?
That depends. Writing a c module for a special project takes time, mostly a lot of time. Many people tend to use some 3rd party modules (if the requirements are met) then writing their own.

or does Apache have to be completely rebuilt?

No, you can compile the module as a shared object with apxs [httpd.apache.org].
6:23 pm on June 4, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:May 22, 2008
posts:92
votes: 0


Carterham,

Thanks for pointing me in the right direction, good to hear that modules can be dynamically linked.

I spent several hours researching all of this and began to see how this works.

It may be that I still need to do further research, load linux and actually get my hands wet but from what I see, developing a web application as an Apache module would be a frightening task without a framework to use, just like it is using IIS without a framework.

In IIS, fortunately, there is an IIS framework that I use called ATL Server, and you can build web applications using that framework that are extremely CPU efficient since apps are written in C or C++ and essentially become dynamically linked extension of the web server itself.

I'm still searching for a web application module framework for Apache. Without one, creating a web application without one would be way too much trouble. If I don't find one, I may take an existing cgi framework and write an Apache module interface for it when I have time available (if ever).

Thanks again,

Jason

9:28 am on June 5, 2009 (gmt 0)

Full Member

10+ Year Member

joined:Dec 20, 2004
posts:330
votes: 0


I don't know hat you need, but basically you can use apache's and apr [apr.apache.org]'s public API.

Another approach would be writing modules with mod_perl.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members