17 Web Servers (Apache and IIS)

Slides:



Advertisements
Similar presentations
Enabling Secure Internet Access with ISA Server
Advertisements

PHP syntax basics. Personal Home Page This is a Hypertext processor It works on the server side It demands a Web-server to be installed.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 21 – Web Servers (IIS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3 System.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 21 – Web Servers (IIS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3 System.
Web App Development with ASP.NET. Introduction In this chapter, we introduce web-app development with Microsoft’s ASP.NET technology. Web-based apps create.
Server-Side vs. Client-Side Scripting Languages
XP Browser and Basics1. XP Browser and Basics2 Learn about Web browser software and Web pages The Web is a collection of files that reside.
Introduction to Web Database Processing
Web Servers How do our requests for resources on the Internet get handled? Can they be located anywhere? Global?
 2002 Prentice Hall. All rights reserved. 1 Chapter 6 – Introduction to the Common Gateway Interface (CGI) Outline 6.1 Introduction 6.2 Client and Web.
Introduction to Web Interface Technology (CSE2030)
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
 2008 Pearson Education, Inc. All rights reserved Web Servers (IIS and Apache)
Topics in this presentation: The Web and how it works Difference between Web pages and web sites Web browsers and Web servers HTML purpose and structure.
Browser and Basics Tutorial 1. Learn about Web browser software and Web pages The Web is a collection of files that reside on computers, called.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
Dynamic Web site With PHP and MySQL. MySQL The combination of MySQL database and PHP scripting language is optimum for building dynamic websites. MySQL.
Web Client/Server Communication A290/A590, Fall /09/2014.
Hands-On Microsoft Windows Server 2008 Chapter 8 Managing Windows Server 2008 Network Services.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Linux Operations and Administration
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
1 Web Servers (IIS and Apache) Outline 9.1 Introduction 9.2 HTTP Request Types 9.3 System Architecture 9.4 Client-Side Scripting versus Server-Side Scripting.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
CSCI 323 – Web Development Chapter 1 - Setting the Scene We’re going to move through the first few chapters pretty quick since they are a review for most.
INTRODUCTION TO WEB DATABASE PROGRAMMING
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 .
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Bookstore Web Application Introducing Visual Web Developer 2008 Express and the.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 29.1 Multi-Tier Architecture 29.2 Web Servers.
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.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
Chapter 1: Introduction to Web
JavaScript, Fourth Edition Chapter 12 Updating Web Pages with AJAX.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
CIM6400 CTNW (04/05) 1 CIM6400 CTNW Lesson 6 – More on Windows 2000.
 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.
 2004 Prentice Hall, Inc. All rights reserved. 1 Segment – 6 Web Server & database.
Kingdom of Saudi Arabia Ministry of Higher Education Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences Chapter.
1 Welcome to CSC 301 Web Programming Charles Frank.
XHTML & Forms. PHP and the WWW PHP and HTML forms – Forms are the main way users can interact with your PHP scrip Typical usage of the form tag in HTML.
1 Web Servers (Chapter 21 – Pages( ) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3 System Architecture.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2 Revised by Dr. T. Tran for CSI3140.
 2008 Pearson Education, Inc. All rights reserved. Chapter 17 Web Servers (Apache and IIS) Internet & World Wide Web How to Program, 5/e.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1 Fundamentals.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
Introduction and Principles Web Server Scripting.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Unit 1 – Web Concepts Instructor: Brent Presley.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
Copyright © 2011 Pearson Addison-Wesley Web Servers and Projects Deployment Chapter 11 – Slide 1.
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.
Web Technology Seminar
2nd year Computer Science & Engineer
4.01 How Web Pages Work.
Web Development Web Servers.
Warm Handshake with Websites, Servers and Web Servers:
E-commerce | WWW World Wide Web - Concepts
E-commerce | WWW World Wide Web - Concepts
Developing Web-Based Applications
PHP / MySQL Introduction
IS333D: MULTI-TIER APPLICATION DEVELOPMENT
17 Web Servers (Apache and IIS)
PHP and Forms.
17 Web Servers (Apache and IIS)
Web Servers (IIS and Apache)
Presentation transcript:

17 Web Servers (Apache and IIS) ©1992-2012by Pearson Education, Inc. All Rights Reserved.

Chapter 17 Web Servers (Apache and IIS) Internet & World Wide Web How to Program, 5/e

©1992-2012by Pearson Education, Inc. All Rights Reserved.

©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.1 Introduction A web server responds to client requests (typically from a web browser) by providing resources such as HTML documents. When users enter a Uniform Resource Locator (URL) address, such as www.deitel.com, into a web browser, they’re requesting a specific document from a web server. The web server maps the URL to a resource on the server (or to a file on the server’s network) and returns the requested resource to the client. A web server and a client communicate using the platform-independent Hypertext Transfer Protocol (HTTP), a protocol for transferring requests and files over the Internet or an intranet. ©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.2 HTTP Transactions URIs (Uniform Resource Identifiers) identify resources on the Internet. URIs that start with http:// are called URLs (Uniform Resource Locators). Common URLs refer to files, directories or server-side code that performs tasks, such as database lookups, Internet searches and business-application processing. A URL contains information that directs a browser to the resource that the user wishes to access. http:// indicates that the HyperText Transfer Protocol (HTTP) should be used to obtain the resource. ©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.2 HTTP Transactions (Cont.) Next in the URL is the server’s fully qualified hostname the name of the web-server computer on which the resource resides. A hostname is translated into an IP (Internet Protocol) address—a numerical value that uniquely identifies the server An Internet domain name system (DNS) server maintains a database of hostnames and their corresponding IP addresses and performs the translations automatically The remainder of the URL after the hostname specifies the resource’s location (/books) and name on the web server For security reasons the path location is typically a virtual directory. The web server translates the virtual directory into a real location on the server, thus hiding the true location of the resource ©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.2 HTTP Transactions (Cont.) When given a web page URL, a web browser uses HTTP to request and display the web page found at that address. HTTP method get indicates that the client wishes to obtain a resource from the server. The remainder of the request provides the path name of the resource (e.g., an HTML5 document) and the protocol’s name and version number (HTTP/1.1). Any server that understands HTTP can receive a get request and respond appropriately. HTTP status code 200 indicates success. Status code 404 informs the client that the web server could not locate the requested resource. A complete list of numeric codes indicating the status of an HTTP transaction can be found at www.w3.org/Protocols/rfc2616/rfc2616-sec10.html ©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.2 HTTP Transactions (Cont.) Next, the server sends one or more HTTP headers, which provide additional information about the data that will be sent. The Multipurpose Internet Mail Extensions (MIME) standard specifies data formats, which programs can use to interpret data correctly. The MIME type text/plain indicates that the sent information is text that can be displayed directly. The MIME type image/jpeg indicates that the content is a JPEG image. When the browser receives this MIME type, it attempts to display the image. The header or set of headers is followed by a blank line, which indicates to the client browser that the server is finished sending HTTP headers. ©1992-2012by Pearson Education, Inc. All Rights Reserved.

©1992-2012by Pearson Education, Inc. All Rights Reserved.

©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.2 HTTP Transactions (Cont.) Two most common HTTP request types get and post get request typically gets (or retrieves) information from a server. Common uses of get requests are to retrieve an HTML document or an image, or search results based on a user-submitted search term. post request typically posts (or sends) data to a server. Common uses of post requests are to send information to a server, such as authentication information or data from a form that gathers user input. An HTTP request often posts data to a server-side form handler that processes the data. A get request appends data to the URL in a query string. A ? separates the query string from the rest of the URL in a get request. A name/value pair is passed to the server with the name and the value separated by an equals sign (=). If more than one name/value pair is submitted, each pair is separated by an ampersand (&). A get request may be initiated by submitting an HTML form whose method attribute is set to "get", or by typing the URL (possibly containing a query string) directly into the browser’s address bar A post request sends form data as an HTTP message, not as part of the URL. A get request limits the query string to a specific number of characters. Large amounts of information must be sent using the post method. ©1992-2012by Pearson Education, Inc. All Rights Reserved.

©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.2 HTTP Transactions (Cont.) Browsers often cache recently viewed web pages so they can quickly reload the pages. If there are no changes between the version stored in the cache and the current version on the web, this helps speed up your browsing experience. ©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.3 Multitier Application Architecture Web-based applications are often multitier applications that divide functionality into separate tiers. Although tiers can be located on the same computer, the tiers of web-based applications typically reside on separate computers. The bottom tier (also called the data tier or the information tier) maintains the application’s data. The middle tier implements business logic, controller logic and presentation logic to control interactions between the application’s clients and its data. Business logic in the middle tier enforces business rules and ensures that data is reliable before the server application updates the database or presents the data to users. Business rules dictate how clients can and cannot access application data, and how applications process data. The top tier, or client tier, is the application’s user interface. In response to user actions, the client tier interacts with the middle tier to make requests and to retrieve data from the information tier. The client tier then displays the data retrieved for the user. The client tier never directly interacts with the information tier. ©1992-2012by Pearson Education, Inc. All Rights Reserved.

©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.4 Client-Side Scripting versus Server-Side Scripting Client-side scripting can be used to validate user input, to interact with the browser, to enhance web pages, and to add client/server communication between a browser and a web server. Client-side scripting does have limitations, such as browser dependency; the browser or scripting host must support the scripting language and capabilities. Client-side scripts can be viewed by the client by using the browser’s source-viewing capability. Sensitive information, such as passwords or other personally identifiable data, should not be stored or validated on the client. ©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.4 Client-Side Scripting versus Server-Side Scripting (Cont.) Placing large amounts of JavaScript on the client can open web applications to security issues. Code executed on the server often generate custom responses for clients. Server-side scripting languages have a wider range of programmatic capabilities than their client-side equivalents. ©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.5 Accessing Web Servers To request documents from web servers, users must know the hostnames on which the web server software resides. Users can request documents from local web servers or remote web servers. Local web servers can be accessed through your computer’s name or through the name localhost—a hostname that references the local machine and normally translates to the IP address 127.0.0.1 (also known as the loopback address). ©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.6 Apache, MySQL and PHP Installation The Apache HTTP Server, maintained by the Apache Software Foundation, is currently the most popular web server. It’s open source software that runs on UNIX, Linux, Mac OS X, Windows and numerous other platforms. MySQL is the most popular open-source database management system. It, too, runs on Linux, Mac OS X and Windows. The Apache HTTP Server, MySQL database server and PHP can each be downloaded and installed separately, but this also requires additional configuration on your part. For simplicity, we’ll use the XAMPP integrated installer provided by the Apache Friends website (www.apachefriends.org). Go to http://www.apachefriends.org/en/xampp.html Choose the installer for your platform. Carefully follow the provided installation instructions and be sure to read the entire installation page for your platform! If you’d prefer to use PHP with Microsoft’s IIS Express and SQL Server Express, you can use their Web Platform Installer to set up and configure PHP: http://www.microsoft.com/web/platform/phponwindows.aspx ©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.6.2 Running XAMP Windows Go to your c:\xampp folder (or the folder in which you installed XAMPP) and double click xampp_start.exe. If you need to stop the servers (e.g., so you can shut down your computer), use xampp_stop.exe in the same folder. Mac OS X Go to your Applications folder (or the folder in which you installed XAMPP), then open the XAMPP folder and run XAMP Control.app. Click the Start buttons in the control panel to start the servers. If you need to stop the servers (e.g., so you can shut down your computer), you can stop them by clicking the Stop buttons. Linux Open a shell and enter the command /opt/lampp/lampp start If you need to stop the servers (e.g., so you can shut down your computer), open a shell and enter the command /opt/lampp/lampp stop ©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.6.3 Testing Your Setup you’ve started the servers, you can open any web browser on your computer and enter the address http://localhost/ to confirm that the web server is up and running. You’re now ready to go! ©1992-2012by Pearson Education, Inc. All Rights Reserved.

©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.6.4 Running the Examples Using Apache HTTP Server Now that the Apache HTTP Server is running on your computer, you can copy the book’s examples into XAMPP’s htdocs folder. Assuming you copy the entire examples folder into the htdocs folder, you can run the examples in Chapters 2–16 and 19 with URLs of the form http://localhost/examples/chapter/figure/filename where chapter is one of the chapter folders (e.g., ch03), figure is a folder for a particular example (e.g., fig03_01) and filename is the page to load (e.g., NewFormInputTypes.html). So, you can run the first example in Chapter 3 with http://localhost/examples/ch03/fig03_01/NewFormInputTyp es.html [Note: The ch02 examples folder does not contain any subfolders.] ©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.7 Microsoft IIS Express and WebMatrix Microsoft Internet Information Services (IIS) is a web server that is included with several versions of Windows. Installing IIS on a machine allows that computer to serve documents. You can install it in a bundle with Microsoft’s WebMatrix—a free development tool for building PHP and ASP.NET web apps. ©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.7.1 Installing and Running IIS Express If you simply want to test your web pages on IIS Express, you can install it from: www.microsoft.com/web/gallery/install.aspx?appid=I ISExpress We recommend using the default installation options. Once you’ve installed IIS Express you can learn more about using it at: learn.iis.net/page.aspx/860/iis-express/ ©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.7.2 Installing and Running WebMatrix You can install the WebMatrix and IIS Express bundle from: www.microsoft.com/web/gallery/install.aspx?appid=I ISExpress Again, we recommend using the default installation options. You can run WebMatrix by opening the Start menu and selecting All Programs > Microsoft WebMatrix > Microsoft WebMatrix. This will also start IIS Express. Microsoft provides tutorials on how to use WebMatrix at: www.microsoft.com/web/post/web-development-101- using-webmatrix ©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.7.3 Running the Client-Side Examples Using IIS Express To execute IIS Express, open a Command Prompt window and change directories to the IIS Express folder. On 32-bit Windows versions, use the command cd "c:\Program Files\IIS Express" On 64-bit Windows versions, use the command cd "c:\Program Files (x86)\IIS Express" If the book’s examples are in a folder named c:\examples, you can use the command iisexpress /path:c:\examples You can now run your examples with URLs of the form http://localhost:8080/chapter/figure/filename ©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.7.4 Running the PHP Examples Using IIS Express The easiest way to test Chapter 19’s PHP examples is to use WebMatrix to enable PHP for the ch19 folder in the book’s examples. To do so, perform the following steps. Run WebMatrix by opening the Start menu and selecting All Programs > Microsoft WebMatrix > Microsoft WebMatrix. In the Quick Start - Microsoft WebMatrix window, select Site From Folder. Locate and select the ch19 folder in the Select Folder window, then click the Select Folder button. This opens the ch19 folder as a website in WebMatrix (). ©1992-2012by Pearson Education, Inc. All Rights Reserved.

©1992-2012by Pearson Education, Inc. All Rights Reserved.

17.7.4 Running the PHP Examples Using IIS Express To enable PHP, perform the following steps: Click the Site option in the bottom-left corner of the window. Click Settings and ensure that Enable PHP is checked (). [Note: The first time you do this, WebMatrix will ask you for permission to install PHP. You must do this to test the PHP examples.] ©1992-2012by Pearson Education, Inc. All Rights Reserved.

©1992-2012by Pearson Education, Inc. All Rights Reserved.