Apache httpd Web Server C. Edward Chow. Advanced Internet & Web Systems chow2 Outline of the Talk Introduction to Apache httpd web server Basic Compilation,

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.
20-753: Fundamentals of Web Programming 1 Lecture 11: Web Server Case Study Fundamentals of Web Programming Lecture 11: Web Server Case Study.
Chapter Apache Installation on Linux. Acknowledgement The contribution made by Darrin Morison is acknowledged.
Initial web server configuration 1WUCM1. Overview Planning Testing the OS/Environment – IP setup Installation Configuration – Simple minimum details Testing.
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.
Initial web server configuration Dr Jim Briggs 1WUCM1.
Apache Configuration Setting up a web server. Basic Server Facts Runs on port 80 Server application -> httpd Richly configurable Many defaults will let.
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.
Installing Apache There are several ways to install the Apache web server – in CIT 370, you probably installed it from the CentOS CD-ROM although in fact,
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.
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.
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.
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.
1 Week 6 The lynx browser Apache Web Server John Wang With materials courtesy of Inge Mclaurin.
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.
Web Technology – Web Server Setup : Chris Uriarte ITI-520: Web Technology Web Server Setup Meeting 2: Apache Installation and Initial Configuration Rutgers.
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.
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.
Apache with SSL and php Apache with ssl support should be the basic platform for providing web services... There are several different implementations.
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.
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
17 Establishing Dial-up Connection to the Internet Using Windows 9x 1.Install and configure the modem 2.Configure Dial-Up Adapter 3.Configure Dial-Up Networking.
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)
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.
Web Technology – Web Server Setup : Chris Uriarte WMB-520: Web Technology Web Server Setup Meeting 2: Apache Installation and Initial Configuration Rutgers.
Free Powerpoint Templates Page 1 Free Powerpoint Templates Chapter 4- Server Configuration.
CITA 310 Section 4 Apache Configuration (Selected Topics from Textbook Chapter 6)
Day 15 Apache. Being a web server Once your system is correctly connected to the network, you could be a web server. –When you go to a web site such as.
Apache Web Server. Outline of the Talk : Introduction to Apache httpd web server Basic Compilation, Installation and Configuration Performance Features:
Web Server Administration Chapter 6 Configuring a Web Server.
Apache Web Server v. 2.2 Reference Manual Chapter 2 Starting Apache.
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
COP 4343 Unix System Administration
Apache and... Virtual Hosts ---- aliases mod_rewrite ---- htaccess
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
Unit-5 Chap-1 Configuring Web Server
Configuring Internet-related services
Apache Web Server
APACHE WEB SERVER.
Presentation transcript:

Apache httpd Web Server C. Edward Chow

Advanced Internet & Web Systems chow2 Outline of the Talk Introduction to Apache httpd web server Basic Compilation, Installation and Configuration Performance Features: Prefork, Cache and Proxy module Virtual Hosting Reference: Introduction to Apache httpd web server Basic Compilation, Installation and Configuration Performance Features: Prefork, Cache and Proxy module Virtual Hosting Reference:

Advanced Internet & Web Systems chow3 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 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.

Advanced Internet & Web Systems chow4 Web Server Installation Statistics Apache is current market share leader in web server. You can download it from See survey statistics in rvey.html rvey.html rvey.html Apache is current market share leader in web server. You can download it from See survey statistics in rvey.html rvey.html rvey.html

Advanced Internet & Web Systems chow5 Apache httpd Releases The current stable release is Apache Apache 2.2.0Apache For win32 version, you can download from any of mirror servers binaries/win32/ The above distribution does not include SSL. Due to patent issues with RSA. Our CS Unix machines currently running Apache The current stable release is Apache Apache 2.2.0Apache For win32 version, you can download from any of mirror servers binaries/win32/ The above distribution does not include SSL. Due to patent issues with RSA. Our CS Unix machines currently running Apache

Advanced Internet & Web Systems chow6 Compiling httpd Download httpd tar.bz2 from or closer mirror sites $tar xjf httpd tar.bz2 $./configure --prefix=PREFIX $ make $ make install $ PREFIX/bin/apachectl start Here PREFIX is the prefix of the directory containing the distribution, typically it is /usr/local/apache. Since as a normal user, we donot have permission to install there, I specify PREFIX as /users/server/students/cs526/public_html/apache2.2m/httpd 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” Here is the command we used to compile the htttpd with proxy and cache modules we need. the command the command Download httpd tar.bz2 from or closer mirror sites $tar xjf httpd tar.bz2 $./configure --prefix=PREFIX $ make $ make install $ PREFIX/bin/apachectl start Here PREFIX is the prefix of the directory containing the distribution, typically it is /usr/local/apache. Since as a normal user, we donot have permission to install there, I specify PREFIX as /users/server/students/cs526/public_html/apache2.2m/httpd 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” Here is the command we used to compile the htttpd with proxy and cache modules we need. the command the command

Advanced Internet & Web Systems chow7 Configure Apache (http and https) on Redhat 9 Apache HTTP Server Configuration 9-Manual/custom-guide/ch-httpdconfig.html 9-Manual/custom-guide/ch-httpdconfig.html 9-Manual/custom-guide/ch-httpdconfig.html Apache HTTP Secure Server Configuration 9-Manual/custom-guide/ch-httpd-secure- server.html 9-Manual/custom-guide/ch-httpd-secure- server.html 9-Manual/custom-guide/ch-httpd-secure- server.html Apache HTTP Server Configuration 9-Manual/custom-guide/ch-httpdconfig.html 9-Manual/custom-guide/ch-httpdconfig.html 9-Manual/custom-guide/ch-httpdconfig.html Apache HTTP Secure Server Configuration 9-Manual/custom-guide/ch-httpd-secure- server.html 9-Manual/custom-guide/ch-httpd-secure- server.html 9-Manual/custom-guide/ch-httpd-secure- server.html

Advanced Internet & Web Systems chow8 Apache Exercises Each site. directory contains conf: configuration files, httpd.conf, mime.types htdocs: contains web pages logs: access_log, error_log, httpd.pid cmd: alias of “ httpd -d serverrootDirectory -X” Here specify the directory contains the httpd program -d specifies the server root directory, -X single process execution Edit the httpd.conf file. Add the following lines Listen 8 TransferLog /user/server/students/ /sites/site. /logs/access_log See detailed in homework exercise. replace with the corresponding site name. Type cmd to start the web server Each site. directory contains conf: configuration files, httpd.conf, mime.types htdocs: contains web pages logs: access_log, error_log, httpd.pid cmd: alias of “ httpd -d serverrootDirectory -X” Here specify the directory contains the httpd program -d specifies the server root directory, -X single process execution Edit the httpd.conf file. Add the following lines Listen 8 TransferLog /user/server/students/ /sites/site. /logs/access_log See detailed in homework exercise. replace with the corresponding site name. Type cmd to start the web server

Advanced Internet & Web Systems chow9 Examine Configuration To security and access reason, we use our login and is created to run httpd Add “User ” and “Group ” to httpd.conf. “tail -f /logs/error_log” or “ps aux | grep ” to see if the server is configured and running. [Sat Feb 7 20:23: ] Server configured -- resuming normal operations or webuser ? S 20:23 0:00 httpd -d /home/cs401 “tail -f /logs/access_log” to see the processing results of client requests usrp16.uccs.edu - - [07/Feb/1998:03:21: ] "GET / HTTP/1.0" Use a browser to access the server a few times with url = where windom is the machine that runs the httpd and 8345 in your designated port number. “kill -9 `cat /logs/httpd.pid`” to terminate web server. note that it is back quote ` and not ‘ -9 is -SIGKILL To security and access reason, we use our login and is created to run httpd Add “User ” and “Group ” to httpd.conf. “tail -f /logs/error_log” or “ps aux | grep ” to see if the server is configured and running. [Sat Feb 7 20:23: ] Server configured -- resuming normal operations or webuser ? S 20:23 0:00 httpd -d /home/cs401 “tail -f /logs/access_log” to see the processing results of client requests usrp16.uccs.edu - - [07/Feb/1998:03:21: ] "GET / HTTP/1.0" Use a browser to access the server a few times with url = where windom is the machine that runs the httpd and 8345 in your designated port number. “kill -9 `cat /logs/httpd.pid`” to terminate web server. note that it is back quote ` and not ‘ -9 is -SIGKILL

Advanced Internet & Web Systems chow10 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 Syntax: directive-name some args Default: directive-name default-value Default: directive-name default-value Context: context-list Context: context-list Override: override Override: override Status: status Status: status Module: module-name Module: module-name Compatibility: compatibility notes 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 Syntax: directive-name some args Default: directive-name default-value Default: directive-name default-value Context: context-list Context: context-list Override: override Override: override Status: status Status: status Module: module-name Module: module-name Compatibility: compatibility notes Compatibility: compatibility notes

Advanced Internet & Web Systems chow11 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.,, 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.,, in ascending order of authority. can overwrite others. dir, file, URL can specify using wildcards and full regular expressions preceded by “~”

Advanced Internet & Web Systems chow12 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)

Advanced Internet & Web Systems chow13 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.

Advanced Internet & Web Systems chow14 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

Advanced Internet & Web Systems chow15 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).

Advanced Internet & Web Systems chow16 Site.Virtual/Name-basedSite.Virtual/Name-based cd /mpc/home/ /sites/site.virtual/Name-based edit the httpd.conf in conf directory: NameVirtualHost  NameVirtualHost Port 8 NameVirtualHost  NameVirtualHost Port 8  Here portno is 8  Here portno is 8 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 NameVirtualHost  NameVirtualHost Port 8  Here portno is 8  Here portno is 8 ServerAdmin  /usr/www  /mpc/home/ /sites/   sales.butterthlies.com Go to start virtual hosting.

Advanced Internet & Web Systems chow17 Site.Virtual/IP-basedSite.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  Here portno is 8 ServerName bilbo.uccs.edu 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  Here portno is 8 ServerName bilbo.uccs.edu ServerAdmin  /usr/www  /mpc/home/ /sites/   ServerName b2b.uccs.edu

Advanced Internet & Web Systems chow18 Site.Virtual/Mixed-basedSite.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

Advanced Internet & Web Systems chow19 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