Web Servers: Shashikant S Kulkarni

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 40

An In-Depth Look into Web Application Administration

Web Servers

Shashikant S Kulkarni

Introduction

Web server

Responds to client requests by providing resources

Web server and client communicate with platformindependent Hypertext Transfer Protocol (HTTP)

Web server architecture

How the WWW Works

(Fitzgerald and Dennis, 2005 Figure 2.8)

Domain Name Server System

HTTP Request Types

GET (default) and POST do basically the same thing: Send data from the client to the server. However, they have some differences: GET

Appends form data directly to the end of the URLvisible to users (not suitable for sending passwords) Limited to 2,048 characters for the entire URL Result page can be bookmarked and cached Sends form data in the HTTP requestinvisible to users Virtually no limit (but check your specific configuration) Results are not cacheable or bookmarkable

POST

System Architecture

Multi-tier application (n-tier application)

Information tier (data or bottom tier)

Maintains data for the application Stores data in a relational database management system (RDBMS) Implements business logic and presentation logic Control interactions between application clients and application data Applications user interface Users interact directly with the application through the client tier

Middle tier

Client tier (top tier)

N-tier Client-Server Architecture

(Fitzgerald and Dennis, 2005 Figure 2.5)

Client-Side Scripting versus ServerSide Scripting

Client-side scripts

Validate user input

Reduce requests needed to be passed to server Access browser Enhance Web pages with DHTML, ActiveX controls, and applets

Server-side scripts

Executed on server Generate custom response for clients Wide range of programmatic capabilities Access to server-side software that extends server functionality

Installing a web server

10

Hosting a website: Self hosting


Install a web server on a computer Local access

Using domain <localhost> or IP address 127.0.0.1 Necessary for server-side programming development
Register a human-readable domain name Obtain IP address

Global access

Static: Costs more Dynamic: Needs dynamic DNS system, e.g. http://www.dyndns.com/

11

Hosting a website: Hosting service

Register a domain name

Assign name servers Host takes care of IP addressing

Develop website locally Upload website via FTP for global access

E.g. Filezilla

12

Web server architecture

LAMP: Most popularfully open source

Linux for operating system Apache for web server MySQL for database PHP for server-side scripting

Others:

WAMP: Uses Windows for operating system, with Apache, MySQL, and PHP WISA: Full Microsoft package

Windows Internet Information Server (IIS) SQL Server (enterprise) or Access (small-scale) ASP or ASP.NET

13

Apache Web Server


Currently the most popular Web server Stability Efficiency Portability Open-source

14

All-in-one Apache/MySQL/PHP packages

EasyPHP

Includes PHPMyAdmin for administering MySQL database Installation and configuration

WAMP Server (recommended)

15

IIS Technologies

Introduction

Designed to deliver high speed and secure information publishing Serves as a platform for developers to extend internet standard communication capabilities Runs as a Windows NT 4.0 (Option Pack) service

IIS Components

Full Scale publishing includes following components

Transport Services Client applications Administrative Tools Database Connectivity Encrypted Communication

IIS 4.0 Components

Purpose

Component

Hypertext Publishing File Transfer ODBC Gateway Encrypted Comm. Server Admn. Hypertext Clients

WWW Server FTP Server Internet D/Base Con. Secure Socket Layer Internet Service Mgr. Browsers

Web Site Content

HTML Pages

HTML Code Client Side Scripts HTML Code Client & Server Side Scripts Components

Active Server Pages (ASPs)

Web Content Creation Tools

Hypertext Text Markup Language (HTML), Dynamic HTML Scripting Languages

JavaScript, Jscript and VBScript

Component Creation Languages

Visual Basic, Java, VisualC++, VisualJ++ etc.

Content Authoring & Management Environment


FrontPage InterDev6.0 IIS Application (VB6.0 Feature) HTML Editors

IIS Application

An IIS (Internet Information Server) application is a Visual Basic application that lives on a Web server and responds to requests from the browser

An IIS application uses HTML to present its user interface and uses compiled Visual Basic code to process requests and respond to events in the browser

IIS Application

To the user, an IIS application appears to be made up of a series of HTML pages To the developer, an IIS application is made up of a special type of object called a webclass, that in turn contains a series of resources called webitems

Browser-IIS Interaction

Browser sends an HTTP request to the IIS for a page on the web server The web server gets the requested page and processes the server side scripts, (which are enclosed within delimiters <% and %>). The scripts can assign values to variables or request information from server (interaction with other tiers)

Browser-IIS Interaction

The processed page containing only HTML and client-side scripts, if any, is sent to the browser

WAMP

What is WAMP?

WAMP = Windows+Apache+MySql+PHP

Note:WAMP5 does not work with Windows 98,Me

WAMP Installation

A single installation file downloaded from http://www.wampserver.com/en/download.php

After Installation
Application Service Apache wampapache PHP MySQL database wampmysql

WAMPs Menu

Management Portals PHPmyadmin SQLitemanager


Note: A user has to click on the icon tray to access WAMP's menu.

WAMPs Menu

Configuration and Settings Loaded Modules Directory Access Shortcut

WAMPs Menu

Services Apache MySQL


Note: The icon tray reflects the status of your server.

Overall

WAMP is easy to install and it is free to use. Migration from IIS/PHP/MsSQL to WAMP is practical. The cost of migration is mainly to review queries and change them based on the SQL extension of MySQL.

Apache Tomcat

35

The Apache Jakarta Project

The Apache Jakarta Project creates and maintains open source solutions on the Java platform for distribution to the public at no charge Apache Jakarta Tomcat--or just Tomcat--is one of those projects Tomcat is a container for Servlets

Tomcat can act as a simple standalone server for Web applications that use HTML, Servlets, and JSP Apache is an industrial-strength, highly optimized server that can be extended with Tomcat

36

Web apps

A web application is basically a web site that:


Knows who you are--it doesnt just give you static pages, it interacts with you Can permanently change data (such as in a database) Static web pages (possibly containing forms) Servlets JSP

A web application can consist of multiple pieces


Tomcat organizes all these parts into a single directory structure for each web application

...but you have to help with the organization

37

What is Apache Tomcat?

Apache is the most common HTTP Web Server on the Internet. The Tomcat server is a Java-based Web Application container which is used to run Servlet and Java Server Pages (JSP) Web applications. Tomcat has become the reference implementation for both the Java Servlets and Java Server Pages specifications. Tomcat was chosen to be the official Sun Web Component (JSP/Servlet ) Container Reference Implementation.

38

What is Apache Tomcat? [Contd.]

Apache Tomcat is used to serve Java Servlets and Java Server Pages. It's a complex piece of software and though the documentation is very comprehensive, it helps to have a good reference work to hand. It is an open source Java Servlet application server used to deploy Java applications after they are built with JSP and Servlets. It can be used as a stand-alone product or it can be integrated with the Apache server.

39

Alternatives to Tomcat

Suns Java Web Server

Old, no longer being developed, all in Java Official reference implementation Difficult to install and configure Open source Opinions vary on how easy it is to install Comes with built-in database

Java Web Server Development Kit (JWSDK)


JBoss

40