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.

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.
1 Configuring Web services (Week 15, Monday 4/17/2006) © Abdou Illia, Spring 2006.
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 on Linux. Acknowledgement The contribution made by Darrin Morison is acknowledged.
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.
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
Web Technology – Web Server Setup : Chris Uriarte ITI-520: Web Technology Web Server Setup Meeting 2: Apache Installation and Initial Configuration Rutgers.
Web Server Configuration Alokes Chattopadhyay Computer & Informatics Centre IIT Kharagpur.
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.
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.
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 Web Server v. 2.2 Reference Manual Chapter 1 Compiling and Installing.
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.
FTP Server and FTP Commands By Nanda Ganesan, Ph.D. © Nanda Ganesan, All Rights Reserved.
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, 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.
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.
CITA 310 Section 4 Apache Configuration (Selected Topics from Textbook Chapter 6)
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 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
Apache with SSL building from source
Ch 22: Web Hosting and Internet Servers
COP 4343 Unix System Administration
Apache and... Virtual Hosts ---- aliases mod_rewrite ---- htaccess
Unix System Administration
Measure Web Performance
INSTALLING AND SETTING UP APACHE2 IN A LINUX ENVIRONMENT
Unit-5 Chap-1 Configuring Web Server
Configuring Internet-related services
Common Gateway Interface (CGI current version 1.1)
Apache Web Server
APACHE WEB SERVER.
Presentation transcript:

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-http://www.apache.org/ABOUT_APACHE.html 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. 9/20/2018 C. Edward Chow

Web Server Installation Statistics http://www.netcraft.co.uk/survey/ 9/20/2018 C. Edward Chow

Compiling Apache_1.3.12 Download apache_1.3.12.tar.gz from http://www.apache.org/dist or closer mirror sites $tar xzvf apache_1.3.12.tar.gz $ ./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. 9/20/2018 C. Edward Chow

CS401 Apache Testbed bilbo.uccs.edu and frodo.uccs.edu are installed with Apache1.3.12. /mpc/home/www/sites contains the configuration files of various web sites contained in the CD-ROM of Apache text. See http://cs.uccs.edu/~cs401/cs401lab.html for more detail on how to carry out the exercise. Copy /mpc/home/www/sites to your directory. To avoid conflict, use port # = 8<last 3 digits of SS#> Add “Port 8<last 3 digits of SS#>“ to httpd.conf. 9/20/2018 C. Edward Chow

Apache Exercise Setup Replace domain name/IP address on 3rd left Linux PC www.butterhlies.com 192.168.123.2 with bilbo.uccs.edu 128.198.192.182 sales.butterthlies.com 192.168.123.3 with b2b.uccs.edu 128.198.192.172 www.faraway.com 192.168.124.1 with wait.uccs.edu 128.198.192.202 Replace domain name/IP address on 4th left Linux PC www.butterhlies.com 192.168.123.2 with frodo.uccs.edu 128.198.192.183 sales.butterthlies.com 192.168.123.3 with feline.uccs.edu 128.198.192.173 www.faraway.com 192.168.124.1 with walden.uccs.edu 128.198.192.203 Replace domain name/IP address on 5th left Linux PC www.butterhlies.com 192.168.123.2 with gandalf.uccs.edu 128.198.192.194 sales.butterthlies.com 192.168.123.3 with gallop.uccs.edu 128.198.192.174 www.faraway.com 192.168.124.1 with wind.uccs.edu 128.198.192.204 9/20/2018 C. Edward Chow

Apache Testbed: LAN Setup /usr/www/lan_setup script for bilbo: ifconfig eth0 128.198.192.182 ifconfig eth0:0 128.198.192.172 ifconfig eth0:1 128.198.192.202 Or on linuxconf for bilbo, select config | networking | IP aliases for virtual hosts | eth0. Type in 128.198.192.172, 128.198.192.202 for IP aliases (I have not succeeded in using the above method.) Normally we skip lan_setup. We will share the same lan_setup. Run the above lan_setup if you find the computer is configured incorrectly (through ifconfig). 9/20/2018 C. Edward Chow

Ifconfig command Interface configuration command. There is an equivalent command ipconfig on win32. In Redhat linux, it is in /sbin. I have modified /etc/profile to include that directory in $PATH. Use ifconfig to show the status Use ifconfig eth0:1 down to shut down the IP aliase. Use ifconfig eth0:1 up to bring it up again. 9/20/2018 C. Edward Chow

Apache Web Site Exercises Each site.<exercise> directory contains conf: configuration files, httpd.conf, srm.conf, access.conf, mime.types htdocs: contains web pages, scripts logs: access_log, error_log, httpd.pid, (referer_log, agent_log) go: alias of “httpd -d xxSITESxx/site.<name> -X” -d for the site directory, -X single process execution Edit the httpd.conf file. Add the following lines Port 8<last 3 digits of your SS#> TransferLog /mpc/home/<login>/sites/site.<name>/logs/access_log In go shell script file, replace xxSITESxx with /mpc/home/<login>/sites replace <name> with the corresponding site name. Type go to start the web server 9/20/2018 C. Edward Chow

Examine httpd Configuration To enhance the security, webuser is created to run httpd Add “User webuser” and “Group webgroup” to httpd.conf. “tail -f <site>/logs/error_log” or “ps aux | grep webuser” to see if the server is configured and running. [Sat Feb 7 20:23:57 1998] Server configured -- resuming normal operations or webuser 13013 0.0 2.2 1260 704 ? S 20:23 0:00 httpd -d /home/cs401 “tail -f <site>/logs/access_log” to see the processing results of client requests usrp16.uccs.edu - - [07/Feb/1998:03:21:16 -0700] "GET / HTTP/1.0" 200 170 Use a browser (on vinci or other machines) to access the server a few times with url = http://bilbo:8345/ “kill `cat <site>/logs/httpd.pid`” to terminate web server. note that it is back quote ` and not ‘ 9/20/2018 C. Edward Chow

Httpd Configuration File Apache uses a set of (73) directives to describe to httpd how the web site should be configured. http://www.apache.org/docs/mod/directives.html 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 9/20/2018 C. Edward Chow

Block Directives Directives that limit the application of other directives. Specify by a group like a tag section in html. <VirtualHost host[:port]> ... </VirtualHost> <VirtualHost…><Directory dir>, <Files file>, <Location URL> in ascending order of authority. <Location> can overwrite others. dir, file, URL can specify using wildcards and full regular expressions preceded by “~” 9/20/2018 C. Edward Chow

List of Directives User, Group: specify user and group that httpd runs on. ServerName: hostname of server (for redirection URL) ResourceConfig, AccessConfig: for reading additional related directives. Can be disabled by /dev/null as value Port: specify the port httpd run on ServerAdmin:email 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 <server root> or /usr/local/etc/httpd) 9/20/2018 C. Edward Chow

Directives KeepAlive [on|off](on): keep connection alive for n requests before terminate provided they come in before timeout. n is defined in MaxKeepAliveRequests <n>(100) directive KeepAliveTimeout <n>(15): wait for the next request for n seconds before terminate the connections. Timeout <n>(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 <n>(256): the limit of # of simultaneous requests (hence the # of child processes). MaxRequestsPerChild <n>(0): Spare(child) server dies after <n> requests, avoid mem leak. 0 mean infinite requests. Min/MaxSpareServers <n>(5/10): # of Idle child servers StartServers <n>(5): sets the number of child server processes created on startup. 9/20/2018 C. Edward Chow

Homework#3 Exercise 1: Site.toddle and Site.simple “cp -r /mpc/home/www/sites /mpc/home/<login>“ Edit the httpd.conf in conf directory DocumentRoot /usr/www/site.simple/htdocs  DocumentRoot /mpc/home/<login>/sites/site.simple/htdocs Port 8<last 3 digits of your SS#> TransferLog logs/access_log Edit go shell script “httpd -d /mpc/home/<login>/sites/site.<name> [-X]“ go in the site.simple does not have –X. go will start the web server. Control-c will terminate it. Use browser to visit the site a few times. Remember to specify the port # in url. For IE browser, type http://bilbo.uccs.edu:<portno>/ or http://frodo.uccs.edu:<portno>/ depending which machine Check the access_log file. Keep them as record 9/20/2018 C. Edward Chow

Homework#3 Exercise 1 User webuser Group webgroup ServerName bilbo.uccs.edu or frodo.uccs.edu DocumentRoot /mpc/home/<login>/sites/site.toddle/htdocs Port 8<last 3 digits of your SS#> TransferLog logs/access_log 9/20/2018 C. Edward Chow

Site.twocopy Create two web servers: one serves customers; one for sales. There are two directories in site.twocopy. In customers/conf/httpd.conf, replace www.butterthlies.com with bilbo.uccs.edu add Port 8<last 3 digits of SS#> Here BindAddress is used to specify the reception of request from specific IP address (domain name) by this web server. BindAddress bilbo.uccs.edu In sales/conf/httpd.conf replace sales.butterthlies.com with b2b.uccs.edu Replace Listen sales.butterthlies.com:80 with Listen b2b.uccs.edu:8<last 3 digits of SS#> httpd -d /mpc/home/<login>/sites/site.twocopy/customers -X httpd -d /mpc/home/<login>/sites/site.twocopy/sales -X 9/20/2018 C. Edward Chow

Web Hosting Named-based vs. IP-based Virtual Host (VH) HOST: <name> a unique IP address for each VH on metaheader different to support a lot of VHs old browsers not support this Use <VirtualHost hostname[:port]> block directives Specify ServerAdmin, DocumentRoot, ServerName, ErrorLog, TransferLog for individual VH Be aware that UNIX File Limits on # of file descriptors. (default 64)  only support 32 VHs? You may want to increase # of child servers. 9/20/2018 C. Edward Chow

Site.Virtual/Name-based cd /mpc/home/<login>/sites/site.virtual/Name-based edit the httpd.conf in conf directory: NameVirtualHost 192.168.123.2  NameVirtualHost 128.198.192.182 Port 8<last 3 digits of SS#> <VirtualHost www.butterthlies.com>  <VirtualHost bilbo.uccs.edu:portno> Here portno is 8<last 3 digits of your SS#> ServerAdmin sales@butterthlies.com  ServerAdmin <login>@cs.uccs.edu /usr/www  /mpc/home/<login>/sites/ <VirtualHost sales.butterthlies.com>  <VirtualHost sales-bilbo.uccs.edu:portno> Go to start virtual hositng. 9/20/2018 C. Edward Chow

Site.Virtual/IP-based cd /mpc/home/<login>/sites/site.virtual/IP-based edit the httpd.conf in conf directory: Add Port 8<last 3 digits of SS#> right after Group webgroup <VirtualHost 192.168.123.2>  <VirtualHost 128.198.192.182:portno> Here portno is 8<last 3 digits of your SS#> ServerName bilbo.uccs.edu ServerAdmin sales@butterthlies.com  ServerAdmin <login>@cs.uccs.edu /usr/www  /mpc/home/<login>/sites/ <VirtualHost 192.168.123.3>  <VirtualHost 128.198.192.172:portno> ServerName b2b.uccs.edu 9/20/2018 C. Edward Chow

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 128.198.192.182:8888 Port 8888 <VirtualHost bilbo.csnet.uccs.edu:8888> DocumentRoot /mpc/home/guest/sites/site.virtual/htdocs/customers <VirtualHost salesbilbo.csnet.uccs.edu:8888> DocumentRoot /mpc/home/guest/sites/site.virtual/htdocs/salesmen <VirtualHost 128.198.192.172:8888> 9/20/2018 C. Edward Chow

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 <VirtualHost 128.198.192.182:7888> DocumentRoot /mpc/home/guest/sites/site.virtual/htdocs/customers <VirtualHost 128.198.192.182:8888> DocumentRoot /mpc/home/guest/sites/site.virtual/htdocs/salesmen 9/20/2018 C. Edward Chow

Bonus Exercise #1 After copying the site.virtual to the nfs mount dir and executing the httpd, the access_log and error_log files are empty. When use the directory mounted on local disk, there are no problem. See the bonus exercise on http://owl/~cs401/bonus.html Try to explain why this happens. A good answer gets 1 point count towards final grade. 9/20/2018 C. Edward Chow

Homework #3 Exercise 2 Run site.virtual/Name-based, site.virtual/IP-based, and site.twocopy according to the textbook and verify the results. Keep the access_log and error_log as records. Send me email when you finish both exercises. 9/20/2018 C. Edward Chow

Homework #3: Problem 3 Explain why it is possible not to require a new IP address to host a customer’s web site, even though it has a unique domain name. 9/20/2018 C. Edward Chow