apache web server architecture chaitanya kulkarni

24
Apache Web Server Apache Web Server Architecture Architecture Chaitanya Kulkarni chaitanya.kulkarni1@maris t.edu MSCS 521 23 rd April 2008 4/23/2008 1 Apache Web Server Architecture

Upload: webhostingguy

Post on 19-May-2015

10.307 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Apache Web Server Architecture Chaitanya Kulkarni

Apache Web Server Apache Web Server ArchitectureArchitecture

Chaitanya [email protected]

MSCS 521 23rd April 2008

4/23/2008 1Apache Web Server

Architecture

Page 2: Apache Web Server Architecture Chaitanya Kulkarni

What is “the web”?

A collection of cross-linked “websites”A set of “web” technologiesThe consistent use of URIs to represent resourcesHTTP, HTML, and everything built around themEvery person's cheap’n’easy client-server computing

4/23/2008 2Apache Web Server

Architecture

Page 3: Apache Web Server Architecture Chaitanya Kulkarni

What is a Server?What is a Server?

A server is a computer or device on a A server is a computer or device on a network that manages network network that manages network resources. Most servers are dedicated. resources. Most servers are dedicated. This means that they perform only one This means that they perform only one task rather than multiple tasks. On task rather than multiple tasks. On multiprocessing operating systems, multiprocessing operating systems, however, a single computer can execute however, a single computer can execute several programs at once. A server in several programs at once. A server in this case could refer to the program that this case could refer to the program that is managing resources rather than the is managing resources rather than the entire computer. entire computer.

4/23/2008 3Apache Web Server

Architecture

Page 4: Apache Web Server Architecture Chaitanya Kulkarni

What is Web Server ?

A computer program that is responsible for accepting HTTP requests from clients, which are known as web browsers, and serving them HTTP responses along with optional data contents, which usually are web pages such as HTML documents and linked objects (images, etc.).

4/23/2008 4Apache Web Server

Architecture

Page 5: Apache Web Server Architecture Chaitanya Kulkarni

A brief history of Apache (1)

First viable alternative to Netscape Communications Corporation web serverIt is an open-source software with cross-platform functionality.First version was created by Robert McCool

4/23/2008 5Apache Web Server

Architecture

Page 6: Apache Web Server Architecture Chaitanya Kulkarni

A brief history of Apache (2)

Named Apache because:- Out of respect for the Native American

Indian tribe of Apache due to the project's roots as a set of

patches to the codebase of NCSA HTTPd 1.3 - making it "a patchy" server.

Chief competitors include Microsoft’s IIS and Sun Java Systems Web Server

4/23/2008 6Apache Web Server

Architecture

Page 7: Apache Web Server Architecture Chaitanya Kulkarni

A brief history of Apache (3)

Apache is used by giants like:- Google Web Servers Wikimedia

The Apache License allows for the distribution of both open and closed source derivations of the source code. The name Apache is a registered trademark.

4/23/2008 7Apache Web Server

Architecture

Page 8: Apache Web Server Architecture Chaitanya Kulkarni

Apache Server Architecture(1)

Apache supports a variety of features, many implemented as compiled modules which extend the core functionality. These can range from server-side programming language support to authentication schemes.

4/23/2008 8Apache Web Server

Architecture

Page 9: Apache Web Server Architecture Chaitanya Kulkarni

Apache Server Architecture(2)

Popular compression methods on Apache include the external extension module, mod_gzip, implemented to help with reduction of the size (weight) of web pages served over HTTP.The core of a Apache Server implements the basic functionality of the server. In addition it implements a number of utility functions

4/23/2008 9Apache Web Server

Architecture

Page 10: Apache Web Server Architecture Chaitanya Kulkarni

Core Component (1)

Following are the components of the Apache core: http_protocol.c http_main.c http_request.c http_core.c

4/23/2008 10Apache Web Server

Architecture

Page 11: Apache Web Server Architecture Chaitanya Kulkarni

Picture Depicting the Core Component

4/23/2008 11Apache Web Server

Architecture

Page 12: Apache Web Server Architecture Chaitanya Kulkarni

How Requests are Handled?(1)

URI to filename translation.

Check access based on host address, and other available information

Get an user id from the HTTP request and validate it

Authorize the user

4/23/2008 12Apache Web Server

Architecture

Page 13: Apache Web Server Architecture Chaitanya Kulkarni

How Requests are Handled?(2)

Determine the MIME type of the requested object (the content type, the encoding and the language).Fix-ups (for example replace aliases by the actual path).Send the actual data back to the client.Log the request.

4/23/2008 13Apache Web Server

Architecture

Page 14: Apache Web Server Architecture Chaitanya Kulkarni

Architecture of an Apache Module

Picture Depicting Apache Module Architecture.

4/23/2008 14Apache Web Server

Architecture

Page 15: Apache Web Server Architecture Chaitanya Kulkarni

The concept of a Handler

A handler is for Apache the action that must be performed in some phase of servicing the requestThey are defined by modules. A module might specify handlers for one, many or none of the phases of the request

4/23/2008 15Apache Web Server

Architecture

Page 16: Apache Web Server Architecture Chaitanya Kulkarni

Persistent Server Processes

‘Persistent Server Processes’ is a concept that explains the implementation of Concurrency in Apache.To handle large incoming requests to website TCP/IP servers fork a new child to handle new incoming request from clients.However in the situation of a busy web site the overhead of forking a huge number of children will simply suffocate the machine.

4/23/2008 16Apache Web Server

Architecture

Page 17: Apache Web Server Architecture Chaitanya Kulkarni

Persistent Server Processes contd..

To solve this problem Apache uses Persistent Server Process.It forks a fixed number of children, right from the beginning. The children service incoming requests independently (different address spaces).It is interesting that Apache server can dynamically control the number of children it forks (i.e. increasing or decreasing it), based on current load.

4/23/2008 17Apache Web Server

Architecture

Page 18: Apache Web Server Architecture Chaitanya Kulkarni

Picture depicting concurrency in Apache.

4/23/2008 18Apache Web Server

Architecture

Page 19: Apache Web Server Architecture Chaitanya Kulkarni

Configure Apache Web Server

The configuration details are given at this site .We have to first configure the DNS. Then configure the following file /etc/httpd/conf/httpd.conf.The root directory of Web server is /etc/httpd, which is divided into three parts.

4/23/2008 19Apache Web Server

Architecture

Page 20: Apache Web Server Architecture Chaitanya Kulkarni

Configure Apache Web Server contd..

The three parts are: /etc/httpd/conf (where configuration

files stays) /etc/httpd/logs (where the logs of Web

server and site accessing stay) /etc/httpd/modules (where the module

stays, which enables the server side programmer to do programming in the languages supported by Web server)

4/23/2008 20Apache Web Server

Architecture

Page 21: Apache Web Server Architecture Chaitanya Kulkarni

Apache Usage.Apache is primarily used to serve both static content and dynamic Web pages on the World Wide Web. Many web applications are designed expecting the environment and features that Apache provides.Apache is the web server component of the popular LAMP web server application stack, alongside MySQL, and the PHP/Perl/Python programming languages.

4/23/2008 21Apache Web Server

Architecture

Page 22: Apache Web Server Architecture Chaitanya Kulkarni

Apache License

The Apache License is a free License authored by Apache Software Foundation or ASF.It allows use of the source code for the development of free and open-source software as well as free software.It is compatible only with the version 3 of GNU Public License or GPL.

4/23/2008 22Apache Web Server

Architecture

Page 23: Apache Web Server Architecture Chaitanya Kulkarni

Reference material

Apache Licensehttp://en.wikipedia.org/wiki/Apache_License

Apache Server Architecturehttp://www.cs.ucsb.edu/~tve/cs290i-sp01/papers/Concept_Apache_Arch.htm

4/23/2008 23Apache Web Server

Architecture

Page 24: Apache Web Server Architecture Chaitanya Kulkarni

Concluding remarks

Apache Web Server has a modular architecture. The core provides the basic functionality and separate set of supporting modules for handling HTTP requests.Implicit Invocation is the architectural style.Concurrency exists only between persistent identical processes that service incoming HTTP requests on the same port.Functionality is easily changed by writing new or editing existing modules.

4/23/2008 24Apache Web Server

Architecture