compliances , security , web-services

The Job of the Apache Web Server is to ?

March 19, 2012

Common knowledge regarding Apache Web Server just all in one place on this blog:

  • Read the Request(s)
  • and send out a Response(s)

 1)      Socket() Create a new socket

2)      bind() Bind the socket to a port

3)      listen() Prepare the socket to listen for connections

4)      accept() Accept an incoming connection

5)      receive() Communicate with the client

6)      send() Communicate with the client

7)      close() Release the resources

The Apache httpd contains a core, a set of modules and utilities.

Httpd has a clean design that enables maintainability.

1)      Isolate minimal core functionality (Core)

2)      Reuse functionality (Utils)

3)      Extensibility (Modules)

 

Core handles low level networking, globals and manages the modules.

1)      About 23,000 Lines of Code

2)      Resides under server/ directory in the source package.

 

Utils gives useful functionality that is shared across the modules and the core.

APR – Apache Portable Runtime

3)      Resource Management (memory, threads)

4)      Data handling (strings)

5)      Data structures (hashtables)

6)      Logging

 

Resource management in APR has a very clever scheme.

1)      Manual management – malloc()/free()

2)      Constructor/Destructor – C++

3)      Garbage Collection – Java/Lisp

4)      APR handles it by giving access to several pools

5)      and gives finer control to the programmer.

 

Resource management in APR has a very clever scheme.

Choose a pool according to the lifetime of the object

1)      apr_palloc            (pool, sizeof (mytype))

2)      Request pool             (request > pool)

3)      Process pool             (request > pool)

4)      Connection pool       (connection > pool)

5)      Configuration pool   (process > pconf)

 

Resource management in APR has a very clever scheme.

Another way of managing resources.

1)      apr_pool_cleanup_register()

 

Avoid double cleanups.

Modules can be linked statically or loaded dynamically.

All features are implemented as modules. (even core features)

This helps achieve many goals software design.

1)      extensibility, flexibility, reusability etc.

www.bestitdocuments.com