0% found this document useful (0 votes)
34 views

Apache HTTP Server 2.2: By, Ahmed Medhat

Apache HTTP Server 2.2 is an open source web server from the Apache Software Foundation. It is easy to install on Linux using package managers like yum. Its configuration file httpd.conf controls directives like the document root, listening port, and log levels. It uses multi-processing modules to handle requests, with popular options being the prefork and worker MPMs. The worker MPM is multi-threaded to efficiently handle requests with fewer resources. Virtual hosts allow hosting multiple sites from one server using name-based or IP-based addresses. Additional modules provide support for languages like PHP, Python, and Ruby. Popular pre-built application stacks are XAMPP and WAMP.

Uploaded by

ultimatetux
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Apache HTTP Server 2.2: By, Ahmed Medhat

Apache HTTP Server 2.2 is an open source web server from the Apache Software Foundation. It is easy to install on Linux using package managers like yum. Its configuration file httpd.conf controls directives like the document root, listening port, and log levels. It uses multi-processing modules to handle requests, with popular options being the prefork and worker MPMs. The worker MPM is multi-threaded to efficiently handle requests with fewer resources. Virtual hosts allow hosting multiple sites from one server using name-based or IP-based addresses. Additional modules provide support for languages like PHP, Python, and Ruby. Popular pre-built application stacks are XAMPP and WAMP.

Uploaded by

ultimatetux
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Apache HTTP Server 2.

By, Ahmed Medhat

Introduction
Apache HTTP Server is a project from Apache Software Foundation a.k.a HTTPD

Installation
Super easy on GNU/Linux, Unix.. On RedHat derivatives
yum install httpd service httpd start

Configuration
/etc/httpd/conf/httpd.conf Important directives:
DocumentRoot (where to serve content) Listen (bind on which socket (ip:port)) LogLevel (debug,info,notice,warn,error,crit,alert,emerg) DirectoryIndex (default directory index page)

Multi-Processing Module
Respecting modularity, you can control the most basic functions of the web server. Responsible for:
Binding to network ports Accepting requests Dispatching request handling children.

Available MPM
Worker (POSIX) Prefork (POSIX) Mpm_winnt (for windows) *wont talk about, Unix biased :)
POSIX = Portable Operating System Interface for Unix

Prefork MPM
Old Apache 1.3 only MPM Non-threaded, for sake of respect to nonthread safe libraries Single process/thread, many child, one process rule them all Resource hungry, Listener process embedded Lots of tuning, expandability needs reconfiguration

Worker MPM
Hybrid multi-process multi-threaded server Many threads, Many requests, Few resources Retains stability by having many processes, each with many threads Respects memory, GC Listener process, The guarding angel process

Sample Request

Virtual Hosts
A blessing for business Many web sites -> one web-server
GET /hello.html HTTP/1.1

Host: www.example.com

Many web sites -> one IP address (name-based)


NameVirtualHost <VirtualHost>

Many web sites -> many IP addresses (IP-based)


Supported out-of-the-box

Sample configuration
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/example.com ServerName example.com ServerAlias www.example.com ErrorLog logs/example.com-error_log CustomLog logs/example.com-access_log common </VirtualHost>

Native Languages Support


mod_php mod_python mod_ruby mod_cgi

Application Stacks Available


XAMPP http://www.apachefriends.org/en/xampp.html WAMP http://www.wampserver.com/en/

Thank you
Questions ?

You might also like