Apache Web Server. Outline of the Talk : Introduction to Apache httpd web server Basic Compilation, Installation and Configuration Performance Features:

Slides:



Advertisements
Similar presentations
What all is there Inside the Apache web server. These slides are part of study material of LAMP course. Course conducted by Prof Rocky Jagtiani – Technical.
Advertisements

Web Server Onno W. Purbo Web server.
1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
Chapter Apache Installation on Linux. Acknowledgement The contribution made by Darrin Morison is acknowledged.
Apache Web Server v. 2.2 Reference Manual Chapter 4 Multi-Processing Modules (MPMs)
Apache Installation by Jack Davis. Web Servers The Apache HTTP Server is the most widely used web server on the Internet. Apache is fast, free, and full-featured.
1 Configuring Web services (Week 15, Monday 4/17/2006) © Abdou Illia, Spring 2006.
Apache Configuration Setting up a web server. Basic Server Facts Runs on port 80 Server application -> httpd Richly configurable Many defaults will let.
Web Servers How do our requests for resources on the Internet get handled? Can they be located anywhere? Global?
Scalability and planning for growth 1WUCM1. Content management issues Structural – Naming (e.g. file, URL) policy – File and directory naming needs: invent/design/borrow.
Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from
CSE 190: Internet Commerce Lecture 4: Web Servers.
Configuring a Web Server. Overview  Understand how a Web server works  Install IIS (Internet Information Services) and Apache Web servers  Examine.
CP476 Internet Computing Browser and Web Server 1 Web Browsers A client software program that allows you to access and view Web pages on the Internet –Examples.
Apache : Installation, Configuration, Basic Security Presented by, Sandeep K Thopucherela, ECE Department.
Linux Networking CIS Why Linux/Unix? Configurability ▫Customizable System to satisfy unique needs. Scalability ▫Able to serve an increasing number.
Dynamic Web site With PHP and MySQL. MySQL The combination of MySQL database and PHP scripting language is optimum for building dynamic websites. MySQL.
APACHE SERVER By Innovationframes.com »
Apache httpd Web Server C. Edward Chow. Advanced Internet & Web Systems chow2 Outline of the Talk Introduction to Apache httpd web server Basic Compilation,
Chapter 22 Web Hosting and Internet Servers Xuanxuan Su.
Virtual Hosts The apache server can handle multiple “web sites” at a time – a web service provider company may have multiple different sites to offer (see.
Linux Operations and Administration
Appendix: Installing AMP (Apache + MySQL + PHP). Training Course, CS, NCTU 2 AMP  AMP A – Apache Web Server M – MySQL Database Server P – PHP Language.
Web Server Configuration Alokes Chattopadhyay Computer & Informatics Centre IIT Kharagpur.
Web Servers Web server software is a product that works with the operating system The server computer can run more than one software product such as .
Web Servers Installation and Configuration May 24, 2001 CIS System Administration Problem Statement The class topic is setting up a Linux server to support.
Web Servers1-1 Web Servers Xingquan (Hill) Zhu
An introduction to Apache. Different Types of Web Servers Apache is the default web server for may Unix servers. IIS is Microsoft’s default web server.
Apache httpd Web Server C. Edward Chow. Advanced Internet & Web Systems chow2 Outline of the Talk Introduction to Apache httpd web server Basic Compilation,
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
Apache + Tomcat. Apache + Tomcat Download mod_webapp.so:
Web Services CSCI N321 – System and Network Administration Copyright © 2007,2008 by Scott Orr and the Trustees of Indiana University.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 21 - Web Servers (IIS, PWS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3.
1 Apache. 2 Module - Apache ♦ Overview This module focuses on configuring and customizing Apache web server. Apache is a commonly used Hypertext Transfer.
1 Apache and Virtual Sites and SSL Dorcas Muthoni.
Apache and... Virtual Hosts ---- aliases mod_rewrite ---- htaccess AFNOG 11 Kigali, Rwanda May 2010 Dorcas Muthoni Courtesy: Hervey Allen.
Database-Driven Web Sites, Second Edition1 Chapter 5 WEB SERVERS.
Apache Web Server. Aim of this section –Introduce you to workings of the most common webserver –Give you a little experience in role of webmaster Configuring.
Apache, MySQL and PHP Installation and Configuration Chapter 1 Apache Installation and Configuration.
Apache Web Server Administration Syed Iqbal Syed Iqbal.
1 Apache and... Virtual Hosts ---- aliases mod_rewrite ---- htaccess AFNOG X Cairo, Egypt May 2009 Hervey Allen.
1 Session 1: Introduction to PHP & MySQL iNET Academy Open Source Web Development.
What's Apache? Apache is open source, powerful, free and runs on more than half of all Internet servers. Let's take a quick look at how to get your Apache.
LinuxChix Apache. Serving Webpages The layer 7 protocol (HTTP) is what our browsers talk to get us the websites we can't seem to live without. HTTP is.
WAMP Windows Apache MySQL and PHP i.e. “WAMP”. Why WAMP? WampServer is a Windows web development environment. It allows you to create and test web pages.
Web Server (Apache httpd ) 1. 2 Apache Web Server A PAtCHy server: developed by the Apache group History- First.
More than one site? Use multiple configuration files Use multiple configuration files  httpd –d {path}  Assumes “conf/httpd.conf” Logging transactions.
Web Server Administration Chapter 6 Configuring a Web Server.
CITA 310 Section 5 Virtual Hosts and Virtual Directories (Selected Topics from Textbook Chapter 6)
Apache Web Server Architecture Chaitanya Kulkarni MSCS rd April /23/20081Apache Web Server Architecture.
APACHE -By V.Gouthaman. The Apache HTTP Server, commonly referred to as Apache is web server software notable for playing a key role in the initial growth.
Presented by Lonnye Bower Fardin Khan Chris Orona APACHE WEB SERVER.
IBM Http Server Basic Administration. CONTENTS Web server IHS How does IHS differ from Apache Basic configurations Advanced Configurations Performance.
Planning, configuring, running and maintaining a web server -1.
CITA 310 Section 4 Apache Configuration (Selected Topics from Textbook Chapter 6)
Chapter 4: server services. The Complete Guide to Linux System Administration2 Objectives Configure network interfaces using command- line and graphical.
Web Server Administration Chapter 6 Configuring a Web Server.
Apache Configuration. Application Install IBM HTTP Server is Apache.
APACHE Apache is generally recognized as the world's most popular Web server (HTTP server). Originally designed for Unix servers, the Apache Web server.
Web and Proxy Server.
Web Technology Seminar
Web Protocols and Practice
Apache web server Quick overview.
Unix System Administration
Apache Web Server A PAtCHy server: developed by the Apache group formed 2/95 around a number of people who provided patch files for NCSA httpd 1.3 by Rob.
INSTALLING AND SETTING UP APACHE2 IN A LINUX ENVIRONMENT
IIS.
Unit-5 Chap-1 Configuring Web Server
Configuring Internet-related services
APACHE WEB SERVER.
Presentation transcript:

Apache Web Server

Outline of the Talk : Introduction to Apache httpd web server Basic Compilation, Installation and Configuration Performance Features: Prefork, Cache and Proxy module Virtual Hosting Introduction to Apache httpd web server Basic Compilation, Installation and Configuration Performance Features: Prefork, Cache and Proxy module Virtual Hosting

Introduction A Patchy server: developed by the Apache group formed 2/95 around a number of people who provided patch files for NCSA httpd 1.3 by Rob McCool. History- First official public release (0.6.2) in April 1995 Add adaptive pre-fork child processes (very important!). Modular structure and API for extensibility (Bob Thau) Port to multiple platforms. Add documentation. Apache 1.0 was released on 12/1/95. Pass NCSA httpd to be #1 server in Internet. A Patchy server: developed by the Apache group formed 2/95 around a number of people who provided patch files for NCSA httpd 1.3 by Rob McCool. History- First official public release (0.6.2) in April 1995 Add adaptive pre-fork child processes (very important!). Modular structure and API for extensibility (Bob Thau) Port to multiple platforms. Add documentation. Apache 1.0 was released on 12/1/95. Pass NCSA httpd to be #1 server in Internet.

Web Server Installation Statistics :

Apache httpd Releases The current stable release is Apache For win32 version, you can download from any of mirror servers. Win32 Binary including OpenSSL 0.9.8o (MSI Installer). Our CS Unix machines currently running Apache Gandalf, walrus, viva, chow.csnet running Apache The current stable release is Apache For win32 version, you can download from any of mirror servers. Win32 Binary including OpenSSL 0.9.8o (MSI Installer). Our CS Unix machines currently running Apache Gandalf, walrus, viva, chow.csnet running Apache

New Features in Apache 2.2 Multi-Processing Module (MPM) Support. Customized for the needs of the particular site. threaded MPM, like worker or event  scalability prefork  stability or compatibility with older software. MPM support for different OS’ (native networking feature mpm_winnt; beos, os2) IPv6 Support. For example, the listen directive syntax IPv6 addresses must be surrounded in square brackets, as in the following example: Listen [2001:db8::a00:20ff:fea7:ccea]:80 Caching Production quality disk caching and memory caching. htcacheclean to clean up mod_disk_cache setups Multi-Processing Module (MPM) Support. Customized for the needs of the particular site. threaded MPM, like worker or event  scalability prefork  stability or compatibility with older software. MPM support for different OS’ (native networking feature mpm_winnt; beos, os2) IPv6 Support. For example, the listen directive syntax IPv6 addresses must be surrounded in square brackets, as in the following example: Listen [2001:db8::a00:20ff:fea7:ccea]:80 Caching Production quality disk caching and memory caching. htcacheclean to clean up mod_disk_cache setups

New Features in Apache 2.2 Smart Filtering Output filter chain called dynamically configured. Filters can be conditionally inserted based on Request/Response header or env variables. Proxy_Balancer Jserv Support for Apache Tomcat. 3 load balancer scheduler algorithms: Weighted Request Counting, Weighted Traffic (byte) Counting, and Pending Request Counting. ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid nofailover=On ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid nofailover=On BalancerMember BalancerMember ProxySet lbmethod=bytraffic # default is byterequest </Proxy> ProxyPass /test balancer://mycluster Smart Filtering Output filter chain called dynamically configured. Filters can be conditionally inserted based on Request/Response header or env variables. Proxy_Balancer Jserv Support for Apache Tomcat. 3 load balancer scheduler algorithms: Weighted Request Counting, Weighted Traffic (byte) Counting, and Pending Request Counting. ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid nofailover=On ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid nofailover=On BalancerMember BalancerMember ProxySet lbmethod=bytraffic # default is byterequest </Proxy> ProxyPass /test balancer://mycluster

How to Install and Configure Apache 2 on Windows: Download Apache 2 Run the Apache Installer Enabling and Disabling the Apache Service Changing the Server Name and Administrator's Address Configuring Apache to Accept Server Side Includes (SSI) Save the Configuration File and Restart Apache For configuring the apache with specific features, we can specify the corresponding features as option to the configure command. You can find the list of features by “./configure –help” Download Apache 2 Run the Apache Installer Enabling and Disabling the Apache Service Changing the Server Name and Administrator's Address Configuring Apache to Accept Server Side Includes (SSI) Save the Configuration File and Restart Apache For configuring the apache with specific features, we can specify the corresponding features as option to the configure command. You can find the list of features by “./configure –help”

How to Test Your Apache Server: To test if your server is installed and configured properly, open up a browser and type "localhost" in the location bar of your browser. You should be able to see the default Apache test page.

Where to Place Your Website By default, your pages should be placed in the "C:\Program Files\Apache Group\Apache2\htdocs" folder for Apache 2.0 and the "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs" folder for Apache 2.2. When your site is ready, simply delete the existing files in the folder and replace them with those you want to test.

Httpd Configuration File Apache uses a set of directives to tell httpd how the web site should be configured. Each Apache configuration directive is described using a common format that looks like this: Syntax: directive-name some args Default: directive-name default-value Context: context-list Override: override Status: status Module: module-name Compatibility: compatibility notes Apache uses a set of directives to tell httpd how the web site should be configured. Each Apache configuration directive is described using a common format that looks like this: Syntax: directive-name some args Default: directive-name default-value Context: context-list Override: override Status: status Module: module-name Compatibility: compatibility notes

Block Directives Directives that limit the application of other directives. Specify by a group like a tag section in html....,, in ascending order of authority. can overwrite others. dir, file, URL can specify using wildcards and full regular expressions preceded by “~” Directives that limit the application of other directives. Specify by a group like a tag section in html....,, in ascending order of authority. can overwrite others. dir, file, URL can specify using wildcards and full regular expressions preceded by “~”

List of Directives User, Group: specify user and group that httpd runs on. ServerName: hostname of server ResourceConfig, AccessConfig: for reading additional related directives. Can be disabled by /dev/null as value Listen: specify the port httpd run on (Port directive is deprecated) ServerAdmin: addr. for browser to do automatic replies. DocumentRoot: TransferLog, ErrorLog, PidFile: where access,error logs, httpd.pid should be located. Can be file or pipe “|rotatelogs” The file is relative to the server root directory (specified in httpd -d or /usr/local/etc/httpd) User, Group: specify user and group that httpd runs on. ServerName: hostname of server ResourceConfig, AccessConfig: for reading additional related directives. Can be disabled by /dev/null as value Listen: specify the port httpd run on (Port directive is deprecated) ServerAdmin: addr. for browser to do automatic replies. DocumentRoot: TransferLog, ErrorLog, PidFile: where access,error logs, httpd.pid should be located. Can be file or pipe “|rotatelogs” The file is relative to the server root directory (specified in httpd -d or /usr/local/etc/httpd)

Performance Related Directives KeepAlive [on|off](on): keep connection alive for n requests before terminate provided they come in before timeout. n is defined in MaxKeepAliveRequests (100) directive KeepAliveTimeout (15): wait for the next request for n seconds before terminate the connections. Timeout (300): max. time in sec for a block data. HostNameLookups [on|off|double](off): do reverse DNS lookup for logging the domain name of the request. MaxClients (256): the limit of # of simultaneous requests (hence the # of child processes). MaxRequestsPerChild (0): Spare(child) server dies after requests, avoid mem leak. 0 mean infinite requests. Min/MaxSpareServers (5/10): # of Idle child servers StartServers (5): sets the number of child server processes created on startup KeepAlive [on|off](on): keep connection alive for n requests before terminate provided they come in before timeout. n is defined in MaxKeepAliveRequests (100) directive KeepAliveTimeout (15): wait for the next request for n seconds before terminate the connections. Timeout (300): max. time in sec for a block data. HostNameLookups [on|off|double](off): do reverse DNS lookup for logging the domain name of the request. MaxClients (256): the limit of # of simultaneous requests (hence the # of child processes). MaxRequestsPerChild (0): Spare(child) server dies after requests, avoid mem leak. 0 mean infinite requests. Min/MaxSpareServers (5/10): # of Idle child servers StartServers (5): sets the number of child server processes created on startup

Web Hosting There are a few way we can host a web site: –Named-based Virtual Hosting –IP-based Virtual Hosting –Virtual Machine Virtual Hosting Name-based Virtual Hosting –A set of hostnames shared the same IP address (similar to alias) –utilize the HOST: meta header in http request (browser fill in the hostname) to distinguish different web site. –Each hostname will have its own site configuration, document root. –Require either the set of hostnames are registered DNS names or the client machines need to configure their ip addresses mapping in hostfiles such as /etc/hosts (Unix) or C:\WINDOWS\system32\drivers\etc\hosts (Windows) IP-based virtual Hosting: –Require a unique IP address for each virtual hosting site –Use IP alieas to configure the same Network Interface Card (NIC) to listen to different IP address, e.g., ifconfig eth0: –Some Unix system sets limit on how many IP aliases can be supported. Use block directives Specify ServerAdmin, DocumentRoot, ServerName, ErrorLog, TransferLog for individual VH There are a few way we can host a web site: –Named-based Virtual Hosting –IP-based Virtual Hosting –Virtual Machine Virtual Hosting Name-based Virtual Hosting –A set of hostnames shared the same IP address (similar to alias) –utilize the HOST: meta header in http request (browser fill in the hostname) to distinguish different web site. –Each hostname will have its own site configuration, document root. –Require either the set of hostnames are registered DNS names or the client machines need to configure their ip addresses mapping in hostfiles such as /etc/hosts (Unix) or C:\WINDOWS\system32\drivers\etc\hosts (Windows) IP-based virtual Hosting: –Require a unique IP address for each virtual hosting site –Use IP alieas to configure the same Network Interface Card (NIC) to listen to different IP address, e.g., ifconfig eth0: –Some Unix system sets limit on how many IP aliases can be supported. Use block directives Specify ServerAdmin, DocumentRoot, ServerName, ErrorLog, TransferLog for individual VH

Virtual Machine Based Virtual Hosting With Virtual Machine (VMWare/VPC). We can configure a virtual machine for each web site. This gives each site total control of the OS of the virtual machine. We can graceful shutdown/restart individual web site (for maintenance/configuration/software updates). –We cannot graceful shutdown and restart individual name-based or IP-based virtual hosting web sites. They share the same Apache httpd, OS, and related software packages. We can configure different software package, OS for each individual web sites. Allow total control for the admin of the web site (root privilege, user creation, etc) Disadvantage: Require more resource (memory, Disk). With Virtual Machine (VMWare/VPC). We can configure a virtual machine for each web site. This gives each site total control of the OS of the virtual machine. We can graceful shutdown/restart individual web site (for maintenance/configuration/software updates). –We cannot graceful shutdown and restart individual name-based or IP-based virtual hosting web sites. They share the same Apache httpd, OS, and related software packages. We can configure different software package, OS for each individual web sites. Allow total control for the admin of the web site (root privilege, user creation, etc) Disadvantage: Require more resource (memory, Disk).

Site.Virtual/Name-based cd /mpc/home/ /sites/site.virtual/Name-based edit the httpd.conf in conf directory: NameVirtualHost  NameVirtualHost Port 8  Here portno is 8 ServerAdmin  ServerAdmin /usr/www  /mpc/home/ /sites/  sales.butterthlies.com Go to start virtual hosting. cd /mpc/home/ /sites/site.virtual/Name-based edit the httpd.conf in conf directory: NameVirtualHost  NameVirtualHost Port 8  Here portno is 8 ServerAdmin  ServerAdmin /usr/www  /mpc/home/ /sites/  sales.butterthlies.com Go to start virtual hosting.

Site.Virtual/IP-based cd /mpc/home/ /sites/site.virtual/IP-based edit the httpd.conf in conf directory: Add Port 8 right after Group webgroup  Here portno is 8 ServerName bilbo.uccs.edu ServerAdmin  ServerAdmin /usr/www  /mpc/home/ /sites/  ServerName b2b.uccs.edu cd /mpc/home/ /sites/site.virtual/IP-based edit the httpd.conf in conf directory: Add Port 8 right after Group webgroup  Here portno is 8 ServerName bilbo.uccs.edu ServerAdmin  ServerAdmin /usr/www  /mpc/home/ /sites/  ServerName b2b.uccs.edu Site.Virtual/Mixed-based

We can mix Name-based with IP-based virtual hosting. Change “IP-based” to “Mixed-based”. An error in config file. NameVirtualHost :8888 Port 8888 DocumentRoot /mpc/home/guest/sites/site.virtual/htdocs/customers DocumentRoot /mpc/home/guest/sites/site.virtual/htdocs/salesmen DocumentRoot /mpc/home/guest/sites/site.virtual/htdocs/salesmen We can mix Name-based with IP-based virtual hosting. Change “IP-based” to “Mixed-based”. An error in config file. NameVirtualHost :8888 Port 8888 DocumentRoot /mpc/home/guest/sites/site.virtual/htdocs/customers DocumentRoot /mpc/home/guest/sites/site.virtual/htdocs/salesmen DocumentRoot /mpc/home/guest/sites/site.virtual/htdocs/salesmen

Port-based Virtual Hosting Can use one IP address to test many sites. Change IP-based to Port-based. An error in config file. Different ports map to different sites. User webuser Group webgroup Listen 7888 Listen 8888 DocumentRoot /mpc/home/guest/sites/site.virtual/htdocs/customers DocumentRoot /mpc/home/guest/sites/site.virtual/htdocs/salesmen Can use one IP address to test many sites. Change IP-based to Port-based. An error in config file. Different ports map to different sites. User webuser Group webgroup Listen 7888 Listen 8888 DocumentRoot /mpc/home/guest/sites/site.virtual/htdocs/customers DocumentRoot /mpc/home/guest/sites/site.virtual/htdocs/salesmen

Apache and IIS' Web server rival NGINX is growing fast The biggest players in the web server business, Apache and IIS, have had the field to themselves for a long time. Now, however, they have to contend with a few seriously capable upstarts, the most prominent of which is Nginx (pronounced ‘engine-x’). This young turk was first developed in 2002 and boasts a growing, dedicated following among many webmasters. Nginx’s popularity is mainly due to being open- source and having the desirable combination of high performance and low resource consumption. It is important to note that Nginx is most often compared to Apache due to its similar open-source philosophy