1 itec 400 Apache Web Server George Vaughan Franklin University.

Slides:



Advertisements
Similar presentations
4.01 How Web Pages Work.
Advertisements

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.
Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from
Introduction to Web Interface Technology (CSE2030)
Internet Technologies -1 Dr. Mohammed Al-Abdulkareem © 2006.
1 實驗十:以 Linux 架設 Internet/Intranet 伺服 器 教師: 助教:. 2 Outline  Background  Linux system  Popular Internet services  Internet services  Internet  HTTP.
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.
World Wide Web WeeSan Lee
Apache : Installation, Configuration, Basic Security Presented by, Sandeep K Thopucherela, ECE Department.
Web Server Setup WEB SERVER SETUP.
Internet Basics.
APACHE SERVER By Innovationframes.com »
Chapter 22 Web Hosting and Internet Servers Xuanxuan Su.
Linux Operations and Administration
Web Browser: Netscape Navigator and Internet Explorer By Bhupendra Ratha, Lecturer School of Library and Information Science Devi Ahilya University, Indore.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Web Server Configuration Alokes Chattopadhyay Computer & Informatics Centre IIT Kharagpur.
The Linux Operating System Lecture 5: Apache Tonga Institute of Higher Education.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 24 – Web Servers (PWS, IIS, Apache, Jigsaw) Outline 24.1Introduction 24.2Microsoft Personal.
A Practical Guide to Fedora and Red Hat Enterprise Linux Unit 10: Basic Apache Configuration and Management Chapter 26: Apache (httpd): Setting Up a Web.
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.
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
1 Web Server Concepts Dr. Awad Khalil Computer Science Department AUC.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
Chapter 1: Introduction to Web
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.
1 John Magee 9 November 2012 CS120 Lecture 17a: Publishing Web pages.
Chapter 6 The World Wide Web. Web Pages Each page is an interactive multimedia publication It can include: text, graphics, music and videos Pages are.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
Programming the Web Web = Computer Network + Hypertext.
1 Apache. 2 Module - Apache ♦ Overview This module focuses on configuring and customizing Apache web server. Apache is a commonly used Hypertext Transfer.
MySQL and PHP Internet and WWW. Computer Basics A Single Computer.
1 Week 6 The lynx browser Apache Web Server John Wang With materials courtesy of Inge Mclaurin.
Kingdom of Saudi Arabia Ministry of Higher Education Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences Chapter.
ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 1 Electronic Commerce: Information Distribution and Messaging.
1 Welcome to CSC 301 Web Programming Charles Frank.
World Wide Web “WWW”, "Web" or "W3". World Wide Web “WWW”, "Web" or "W3"
WWW: an Internet application Bill Chu. © Bei-Tseng Chu Aug 2000 WWW Web and HTTP WWW web is an interconnected information servers each server maintains.
COP 3813 Intro to Internet Computing Prof. Roy Levow Lecture 1.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1 Fundamentals.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
CS 6401 The World Wide Web Outline Background Structure Protocols.
Web Server Administration Chapter 6 Configuring a Web Server.
Apache Web Server Architecture Chaitanya Kulkarni MSCS rd April /23/20081Apache Web Server Architecture.
Presented by Lonnye Bower Fardin Khan Chris Orona APACHE WEB SERVER.
Web Server Apache PHP HTTP Request User types URL into browser Address resolved if nec. We use directly Most browsers request.
JavaScript and Ajax (Internet Background) Week 1 Web site:
BZUPAGES.COM WEB SERVER PRESENTED TO: SIR AHMAD KAREEM.
Matthew Baillie, Luke Day THE INTERNET. HISTORY OF THE INTERNET J.C.R. Licklider authored a series of memos concerning theoretical network structures.
Planning, configuring, running and maintaining a web server -1.
ULI101 – XHTML Basics (Part I) Internet / Web Concepts Brief History TCP/IP Web Servers / Web Browsers URL HTTP / HTML.
Web Server Administration Chapter 6 Configuring a Web Server.
APACHE Apache is generally recognized as the world's most popular Web server (HTTP server). Originally designed for Unix servers, the Apache Web server.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
4.01 How Web Pages Work.
Web and Proxy Server.
WWW and HTTP King Fahd University of Petroleum & Minerals
Ch 22: Web Hosting and Internet Servers
COP 4343 Unix System Administration
JavaScript and Ajax (Internet Background)
CNIT 131 Internet Basics & Beginning HTML
SUBMITTED BY: NAIMISHYA ATRI(7TH SEM) IT BRANCH
MapServer In its most basic form, MapServer is a CGI program that sits inactive on your Web server. When a request is sent to MapServer, it uses.
APACHE WEB SERVER.
Web Servers (IIS and Apache)
Presentation transcript:

1 itec 400 Apache Web Server George Vaughan Franklin University

2 Topics Background information –HTTP, URLs, Web History Apache Web Server: –History, how it works Configuring, Running and Administering the Apache Web Server. Perl scripts and the Apache Web Server.

3 The Web The WWW and the internet are not the same. We can view the WWW as a very general client-server application running on the internet. The WWW is based on a client - server architecture –Browser is the client –Web server is the server

4 HTTP The browser and the web server communicate with each other using Hyper Text Transfer Protocol (HTTP). HTTP defines how messages are transmitted and what actions the browser and server perform when such messages are received. HTTP is a stateless protocol.

5 URL The browser uses HTTP to request objects using a Universal Resource Locator (URL). The URL is the global address of an object.

6 URL An example of a URL: Where: –‘http’ specifies the protocol –‘cs.franklin.edu’ specifies the web server host. –‘:80’ specifies the host port (80 is default) –The first slash after the port is the ‘Doc Root’ –‘some_dir’ is a directory under ‘Doc Root’ –‘webPage.html’ is the target object

7 A Little History of the WWW* *Notes from ’s –Ted Nelson coins the word Hypertext in A File Structure for the Complex, the Changing, and the Indeterminate. 20th National Conference, New York, Association for Computing Machinery, 1965 Association for Computing Machinery –Doug Engelbart prototypes an "oNLine System" (NLS) which does hypertext browsing editing, , etc. He invents the mouse for this purpose. to see 1968 demo, visit:

8 A Little History of the WWW* *Notes from –While consulting for CERN June-December of 1980, Tim Berners-Lee writes a notebook program, "Enquire-Within-Upon-Everything", which allows links to be made between arbitrary nodes. –CERN - European Organization for Nuclear Research 1990 –October - Tim Berners-Lee starts work on a hypertext GUI browser+editor –Coins the term "WorldWideWeb" as a name for the program.

9 A Little History of the WWW* *Notes from –February - NCSA release first alpha version of Marc Andreessen's "Mosaic for X". –September - WWW (Port 80 http) traffic measures 1% of NSF backbone traffic. –NCSA - National Center for Supercomputing ApplicationsNational Center for Supercomputing Applications 1994 –March - Marc Andreessen and colleagues leave NCSA to form "Mosaic Communications Corp" (later Netscape) More than 80 percent of all Internet traffic is WWW traffic

10 History of Apache Like Mosaic and Netscape Browsers, the Apache Web Server can trace its root to NCSA. Apache was originally based on code from an NCSA web server (circa 1995). The original Apache web server was ‘a patchy’ version of the NCSA web server - hence the name

11 Apache Web Server The name of the Apache binary in Unix/Linux is: httpd (goes back to NCSA) and is located at /usr/sbin/httpd. httpd executes under the login ID of ‘apache’, except for the first instance which is run under ‘root’. When the Apache project was started (1995), the NCSA web server was the most popular web server.

12 Apache Web Server The Apache Web Server is free. Can be downloaded at: Comes bundled with RedHat (Apache 2.0 comes with Fedora 3.0).

13 How Apache Works Apache sits and listens to the IP addresses and port specified in its Config file. The default port is 80. Can be configured to listen to other ports.

14 Apache Market Share (Data from: Market Share for Top Servers Across All Domains August February 2006 Developer January 2006 Percent February 2006 Percent Change Apache Microsoft Sun Zeus

15 Running Apache The following slides are based on Apache 2.0 running on Fedora 3.0 Below is check to see if Apache is already installed: bin]# rpm -q httpd httpd Edit the config file /etc/httpd/conf/httpd.conf –Search for the line that begins with: #ServerName –Uncomment the line and replace with name of server or IP addresswww.example.com –example: ServerName :80 –save the file.

16 Running Apache The Apache binary is located at: /usr/sbin/httpd You must be root to start httpd - this is because only root can listen to ports below port By default, web servers listen to port 80. You may start the server by typing: service httpd start

17 Running Apache 0001: root]# service httpd start 0002: Starting httpd: [ OK ] 0003: 0004: root]# service httpd status 0005: httpd (pid ) is running : 0007: root]# service httpd stop 0008: Stopping httpd: [ OK ] Notes: Line 1: start the web server Line 4: check web server status (pid’s of server processes Line 8: stop the web server

18 Running Apache There will be one instance of httpd per request being serviced, plus some additional instances that are waiting. One instance will be owned by root. The remaining instances will be owned by the default user name (apache): httpd]# ps -ef | fgrep httpd root :20 ? 00:00:00 /usr/sbin/httpd apache :20 ? 00:00:00 /usr/sbin/httpd apache :20 ? 00:00:00 /usr/sbin/httpd apache :20 ? 00:00:00 /usr/sbin/httpd apache :20 ? 00:00:00 /usr/sbin/httpd apache :20 ? 00:00:00 /usr/sbin/httpd apache :20 ? 00:00:00 /usr/sbin/httpd apache :20 ? 00:00:00 /usr/sbin/httpd apache :20 ? 00:00:00 /usr/sbin/httpd Each Server process is mult-threaded. The initial number of severs is tunable. The number of server processes may grow or shrink automatically, based on load.

19 Running Apache You can test your web server by using the local host URL: which will produce the web page on next slidehttp:// / You do not have to have your server on a network to perform this test.

20 Running Apache

21 Running Apache We can create our own default web page Name the file index.html Place file in the directory: /var/www/html Now we can see our own default web page when we use the local host URL: which will produce the web page on next slide.

22 Running Apache

23 Apache Auto-Start Apache does not automatically start at boot as delivered by Fedora. It is easy to make Apache start at boot with the chkconfig command (see man page): 0001: init.d]# chkconfig --list httpd 0002: httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off 0003: 0004: root]# chkconfig httpd on 0005: 0006: root]# chkconfig --list httpd 0007: httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off

24 Apache Manual You may also install an html based manual for Apache (this is a separate package from Apache itself). Below is a check to see if the manual is installed: ~]# rpm -q httpd-manual httpd-manual If the manual is not installed, you may use the ‘rpm’ installation mechanism to install it after it has been downloaded. Once installed, the manual can be accessed locally on the server using the following URL: The next slide shows the home page for the manual.

25 Apache Manual

26 Configuring Apache Configuration file –located at /etc/httpd/conf/httpd.conf ASCII file – can be edited with ‘vi’ –contains such things as: server name port(s) to listen on default user name (apache) Document Root (/var/www/html) error log location (/var/log/httpd/error_log) many, many other paraemeters

27 Configuring Apache apacheconfig: –Program to generate config file –Located at /usr/share/apacheconf –Will overwrite any manually created/modified config file. It is probably best to learn how to configure Apache manually using: vi /etc/httpd/conf/httpd.conf

28 /etc/httpd/conf/httpd.conf The Apache config file has many directives. One directive defines the ‘Document’ root. The concept is the same as the ‘root’ directory in Unix. The document root is the top level directory for web content. By default, the top level document root in Apache is /var/www/html, but can be changed. The directive appears below: # # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "/var/www/html"

29 /etc/httpd/conf/httpd.conf The following directive allows users to have user level doc roots at ~/public_html Disabled by default for security since it can be used to confirm lognames on the system UserDir public_html UserDir disabled root

30 etc/httpd/conf/httpd.conf The following server directive allows a browser to collect server information. Will only work on browser on server for security. URL: SetHandler server-info Order Deny,Allow Deny from all Allow from Next slide shows browser contents

31

32 etc/httpd/conf/httpd.conf The following server directive allows a browser to collect server information. Will only work on browser on server for security. URL: SetHandler server-status Order Deny,Allow Deny from all Allow from Next slide shows browser contents

33

34 Webalizer Apache includes the webalizer which produces run-time statistics on server performance. Start at command line: webalizer Start from browser: Next page contains a snapshot

35

36 Apache Log Files Apache maintains an access log and an error log. The access log is located at: /var/log/httpd/access_log The access log logs who accessed what and from where: [16/Mar/2003:23:19: ] "GET /icons/text.gif HTTP/1.1" [16/Mar/2003:23:19: ] "GET /icons/back.gif HTTP/1.1" [16/Mar/2003:23:19: ] "GET /icons/image2.gif HTTP/1.1" [17/Mar/2003:20:18: ] "GET / HTTP/1.1"

37 Apache Log Files The Apache error log is located at: /var/log/httpd/error_log The error log tracks server operations (not necessarily errors): [Sun Mar 16 23:59: ] [notice] caught SIGTERM, shutting down [Mon Mar 17 19:23: ] [notice] SIGHUP received. Attempting to restart [Mon Mar 17 19:23: ] [notice] Apache/ (Unix) (Red- Hat/Linux) mod_ssl/2.8.4 OpenSSL/0.9.6b DAV/1.0.2 PHP/4.0.6 mod_perl/1.24_01 configured -- resuming normal operations

38 CGI Scripts CGI scripts go in /var/www/cgi-bin and not /var/www/html More secure - /var/www/cgi-bin is not under doc root (harder to find) Doc Root has general access - /var/www/cgi-bin can be made more restrtictive. The following config parameter maps “cgi-bin” in Doc Root search space: ScriptAlias /cgi-bin/ "/var/www/cgi-bin/“ The URL for a cgi script might look like this:

39 Apache and Perl Scripts The Apache architecture is flexible. New functionality can be added by loading Apache modules. One such module is: mod_perl perl scripts can still executed without mod_perl. Without mod_perl, perl scripts are executed as CGI scripts Installed Apache modules are located at: /etc/httpd/modules

40 Apache and Perl Scripts The disadvantage of running a perl script using CGI: –each time a Perl script runs, Apache has to load the Perl interpreter. –If our site has only one page (onePage.pl) and if we have 100,000 visitors, the interpreter has to be loaded 100,000 time and the script has to be loaded and compiled a 100,000 times.

41 Apache and Perl Scripts mod_perl basically embeds the Perl interpreter into Apache Perl scripts run within Apache rather than as a separate process. Running scripts using mod_perl can be 100 times faster than using CGI mod_perl allows perl scripts to interact with the Apache web server itself.

42 Apache and Perl Scripts Perl scripts can also be cached using mod_perl. This means that perl scripts are compiled only once. See perl.apache.org Apache 2.0 in RedHat 9.0 comes with mod_perl already configured.

43 Virtual Hosts Apache can be configured to support multiple ‘virtual hosts’. In other words, Apache can be configured to support multiple web sites on a single machine. When a request comes in, Apache uses the IP address, port, and hostname to determine which virtual host should service the request. Each virtual host can have its own server name, doc root, error log, transer log, config file, etc…

44 Tux Tux is a web server that comes with RedHat. Tux does not replace Apache is works with Apache. Tux runs at the kernel level -very fast. Tux is used to server static pages. Tax forwards more complex requests to Apache See patches/2.1-docs/index.htmlhttp://people.redhat.com/mingo/TUX- patches/2.1-docs/index.html

45 References Red Hat Fedora and Enterprise Linux 4 Bible, Christopher Negus, Apache – The Definitive Guide, Ben Laurie and Peter Laurie, 2003.