3. Installation
• Super easy on GNU/Linux, Unix..
• On RedHat derivatives
– yum install httpd
– service httpd start
4. 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)
5. 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) *won’t talk about, Unix biased :)
POSIX = Portable Operating System Interface for Unix
6. Prefork MPM
• Old Apache 1.3 only MPM
• Non-threaded, for sake of respect to non-
thread safe libraries
• Single process/thread, many child, one
process rule them all
• Resource hungry, Listener process embedded
• Lots of tuning, expandability needs
reconfiguration
7. 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
9. 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 webmaster@example.com
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>