Web Server (Apache httpd ) 1. 2 Apache Web Server A PAtCHy server: developed by the Apache group History-http://httpd.apache.org/ABOUT_APACHE.html First.

Slides:



Advertisements
Similar presentations
Enabling Secure Internet Access with ISA Server
Advertisements

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.
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 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.
Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from
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.
70-293: MCSE Guide to Planning a Microsoft Windows Server 2003 Network, Enhanced Chapter 7: Planning a DNS Strategy.
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,
1 Chapter Overview Introduction to Windows XP Professional Printing Setting Up Network Printers Connecting to Network Printers Configuring Network Printers.
Web Client/Server Communication A290/A590, Fall /09/2014.
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
Ch 8-3 Working with domains and Active Directory.
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.
Apache Server The Apache Server Apache is a WWW server that implements the HTTP protocol. Apache runs as a daemon. This means that it is a resident.
Web Servers1-1 Web Servers Xingquan (Hill) Zhu
Connecting to Network. ♦ Overview ► A network connection is required to communicate with other computers when they are in a network. Network interface.
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,
Apache, PHP, MySQL Installation and configuration Web Programming with PHP,TITAS PROJECTIICT,BUET.
Setting up NIS and HTTP. Network Information Service Reading: 1. Linux NIS HOWTO: howto/HOWTOhttp://
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.
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.
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®
1 Chapter Overview Creating Web Sites and FTP Sites Creating Virtual Directories Managing Site Security Troubleshooting IIS.
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.
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:
Multi-Domain Hosting CPTE 212 “Missing Slides” for 1/22/2015 John Beckett.
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.
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.
Application layer Lecture 7.
Unit-5 Chap-1 Configuring Web Server
Configuring Internet-related services
APACHE WEB SERVER.
Presentation transcript:

Web Server (Apache httpd ) 1

2 Apache Web Server A PAtCHy server: developed by the Apache group History- First official public release (0.6.2) in April 1995 Add adaptive pre-fork child processes (very important!). Port to multiple platforms. Add documentation. Apache 1.0 was released on 12/1/95.

3 Compiling httpd Download httpd tar.bz2 from or closer mirror siteshttp:// $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/http d 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

4 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

5 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

6 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 “~”

7 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.

8 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.

9 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

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 figure 6-2) – a single company may wish to partition their web site into multiple domains (e.g., sales, accounting, management, research, etc) (see figure 6-1) – a single organization may wish to give each user their own web site In any of these cases, the idea is to have the web server create several virtual hosts – although in the last case, we just divide the file space up We use the container for this, which allows each “host” to have their own server-specific configuration – we can divide our hosts up based on IP addresses or IP aliases – the container looks like this: ServerName ipalias DocumentRoot path 10

IP-Based Assume that we want each of our servers to have a unique IP address – in fact, we will have to set up the DNS entries so that all of the different IP addresses resolve to the same IP address, that of our web server see figure 6-3 Now we place in our httpd.conf file containers for each server – one container per server – this allows us to add more servers over time (or remove servers) just by modifying the httpd.conf file each virtual host will apply the overall server configuration but you can also specify server-specific directives for each virtual host as is needed many of the directives we saw from chapter 5 that dealt with 1 server can be applied to any, each or some combination of servers 11

More Each container will have its own unique IP address To the right, you see three different servers Notice how each server maps to a different location under DocumentRoot We might create symbolic links so that each company can edit their own directory from a location that they are more familiar with We can also set up our various servers to respond to different ports of the same IP address (see the right below) ServerName DocumentRoot /home/company1 ServerName DocumentRoot /home/company2 ServerName DocumentRoot /home/company3 ServerName DocumentRoot /home/company1 ServerName DocumentRoot /home/company2 12

Name-Based If we want all of our servers to share the same IP address, there is only one major difference required to the apache server – we must add the directive NameVirtualHost ipaddress to our httpd.conf file where ipaddress is the shared IP address of all servers this same address will be placed in each server’s container We will also have to ensure that all DNS servers resolve any of the servers’ aliases to this same address NameVirtualHost ServerName DocumentRoot /home/company1 ServerName DocumentRoot /company2 ServerName DocumentRoot /home/company3 13

More We can use the name-based approach to allow multiple alias names to map to the same server by supplying numerous ServerAlias directives within a VirtualHost container – for instance, imagine that wishes to also be recognized by company1.com, and sales.company1.com We can also permit the * or ? wildcard to save on the number of entries we might want to put into our container – however, this can easily result in problems with respect to have misspelled server names map to the wrong thing ServerName ServerAlias company1.com ServerAlias ServerAlias ServerAlias sales.company1.com DocumentRoot /home/company1 Or ServerName ServerAlias company1.com ServerAlias *.company1.com ServerAlias DocumentRoot /home/company1 14

Some Additional Comments If we just add the previous entries into our httpd.conf file, it does us no good unless we also ensure that DNS entries have the same mappings – for instance, if you are at site X and issue an http request for if the DNS for site X does not map to , then the http request never makes it to our server for processing! – so we have to make sure that the DNS tables across the Internet reflect the proper mappings we have already set up a BIND server, so we will explore this in the next labs You can use both IP-based and Name-based virtual hosts if desired by having some VirtualHosts share the same IP address and others have different addresses – this will require that you use NameVirtualHost for any shared address 15

Continued If you are using name-based virtual hosts, then any http request that reaches your server will already have had the IP address resolved – because of this, we do not have to put IP addresses in our VirtualHost containers, but can replace them with * the * will match any IP address only do this with the name-based approach, if you use the IP- based approach, then each virtual host maps to a unique address If your computer has multiple IP addresses (e.g., an internal address and an external address) – you can place all IP addresses in the VirtualHost container (and the NameVirtualHost directive) NameVirtualHost NameVirtualHost … 16

Include Files Recall that not all directives need to be placed in the httpd.conf file – in fact, for virtual hosts, you would not want this because each server’s web administrator(s) will need to edit the configuration file for that server if all directives were shared in one file, then you would have to give many different people access to that one file – therefore, we allow the administrators to place these server-wide directives in a different file, which is then included with the httpd.conf directives via include directives 17

Overriding httpd.conf Directives Recall that the outermost context is the server’s settings – we do not want our individual administrators to have access to httpd.conf but we want to allow them to have their own specific directives in their include files – so, in our httpd.conf file, we need to add the AllowOverride directive to any DocumentRoot directory for instance, in the container for company1, you will add and place the AllowOverride All directive in that container – the question is, do we want to use “All” in our AllowOverride or be more specific? AllowOverride can have None, All, or any subset of this list: – AuthConfig, FileInfo, Indexes, Limit, Options see the example to the right ServerName DocumentRoot /home/company1 AllowOverride Indexes Options 18

Example NameVirtualHost Order allow,deny Deny from all ServerName DocumentRoot /var/www/hosts/company1 AllowOverride all Allow from all ServerName DocumentRoot /var/www/hosts/company2 AllowOverride all Allow from all Establish protection for directories above any virtual host’s directory Override any directives and protection from the previous directory 19

Web Site Structure 20

Virtual Host Performance and Status The only real drawback to using virtual hosts is that the more hosts you have, the worse the server’s performance will be – running 10 servers instead of 1 will probably result in 10 times the number of requests to service and thus the server will be 10 times more busy – running 10 servers instead of 1 will probably require 10 times the amount of disk usage an ISP that wishes to provide web server services will have to take this into account when purchasing server hardware To determine the status of the various servers, use httpd –S which will list – IP address and port (if different from the default server) – name of the server – location of DocumentRoot for the given server we will examine status information in more detail in chapter 7 21

Remember Basic Configurations Virtual Hosting & its Types 22