<? LESSON 1 ?>
Lesson 1   spacerspacer

Web Service With a Smile

A web server gets it's name because it "serves" up web pages. Every web page you have every seen was served at one time to your browser, unless the html existed on your computer.

Whenever a person clicks on a web page, the browser sends a page request to their Internet Service Provider (ISP) which consequently queries it's resources to find an address that matches that request. The ISP likely has a Domain Name Server (DNS) which looks at the web address that you typed in, (or clicked on as a link), which looks like this:

http://www.blah.com/

The ISP will send this to a special server called a Domain Name Server (DNS) that has software to translate the "english based" blah.com to a number, as all internet addresses are really numbers like this:

http://212.21.34.47/

Your request bounces through the internet on special devices called routers and switches (both specialized computers) until your request reaches the server that is hosting the page you requested. When it reaches the server, your page is generated and then bounced back to you, again through the internet, until the string of ones and zeros are recombined into the web page you can see.

Most web servers are running operating systems based on Unix, an operating system created in the early 1970s. It is noted for being very stable, quick and obscure. The source code of the operating system has been available for many years, which has led to many "versions" (flavors) of Unix being developed.

This operating system is famous for being "command line" based, meaning that it is built to run without any graphical elements whatever. Companies that build their own versions of Unix (flavors) sometimes build a graphical component as well (a GUI, or Window environment). Linux is a new and popular variation of a Unix based operating system.

Road Rules on the Internet Superhighway

Most Unix based web servers run a "free" web server software called Apache to serve up it's web pages. The web server software is very important to the server, because without it, the server is just a computer. The web server must also have a set of "rules" established for transmission of data between the web server and the browser. The original set of "rules" is called the Common Gateway Interface (CGI). The CGI allows a programmer to interface with the information and services provided on the server regardless of the programming language chosen.

Introducing Micro$oft:

Microsoft has it's own version of web server software, called Internet Information Server (IIS). IIS has been included in one version or another of Microsoft Server software since NT 4.0 (1996). The advantages of using Microsoft server products includes GUI (Windows) configuration, ease of deployment and industry giant support.

Dynamic Web Pages

Web pages written in pure HTML are considered as static pages, since they are unable to change according to user input. Web pages can be created that are more dynamic (flexible, and changeable) using one of 2 approaches. The differences between these 2 are extremely signifcant to web developers.

Client Side Scripting

Programs can be designed to run independent of the server. In this case, the program code is built into the web page, and is run by the user's browser. Since the user is the client of the server, this is called client side scripting. The advantage of this process is that the server is not tied up unnecessarily running scripts for the user. The disadvantage is the user can gain access to the data, making it insecure. JavaScript is the client side scripting language of choice, as it is the most widely accepted language.

Server Side Scripting

Programs designed to run in the course of serving up web pages and are housed on on the server use server side scripting. It has the advantages of being potentially more secure than client side scripting, and can be used to access data stores such as text files and databases.

Server-side scripting allows us to provide dynamic content based on user interaction, and our business logic requirements. Unlike a typical HTML page, which displays static information, a page that incorporates server-side scripting can change dynamically over time, interact with databases and other data sources, and provide content and transactions with users. In our class, we will focus on server side scripting. Server side scripting languages include, Perl, PHP, VBScript, and Java.

Server Side Preprocessor

Most dynamic page environments use a special program that intercepts the request for a page by the user, and processes the page in advance of sending it to the server software. This "pre-processor" allows the server to serve up straightforward pages (as far as it knows) due to the fact that the "pre-processor" filters out the request and feeds the required page to server to create the dynamic effect. The way to see this is to look at the source code generated by a dynamic processor, like the PHP pre-processor, or the ASP pre-processor (Microsoft). The source code looks like any other static page (only uglier, potentially much uglier, since the code is dynamically produced by a machine) and is only the OUTPUT of the PHP page written by the developer! This is why we must never overwrite a dynamic page with it's static output.

Web Databases

Data is stored and accessed over the web by a Database Management Systems (DBMS) designed to facilitate access to the data. The abilities and limitations of the DBMS are a major concern to the developer, who must limit the number and duration of "hits" to the database in order to allow it to serve many users. The DBMS systems allow a developer to create Queries to access the data, using their own variant of a universal database language called SQL. Web database systems in use today include Oracle, SQL Server, Microsoft Access and MySQL.

The Developers Environment

The developer will usually need to choose between programming environments that include compatible elements. It is not usually recommended to mix environments to a great degree, as there are many potential pitfalls. The most common potential web development environments are PHP, ASP, JSP, Cold Fusion and the .NET environment. Below are examples of the environments a developer may choose:

Operating System Server Software Pre-processor Scripting Language DBMS Ext.
Red Hat Linux 9.0 Apache 2.0 PHP pre-processor PHP MySQL .php
Windows 2000 IIS 5.0 ASP 3.0 pre-processor VBScript MS Access .asp
Windows 2003 IIS 6.0 .NET environment C# SQL Server .aspx
Unix/Windows J2EE/Tomcat JSP/Servlets Java Oracle .jsp

For our purposes, we have chosen PHP with MySQL as our development environment. The advantages are that the pages will run on Linux/Unix servers which are very stable and secure, and run on Apache web server software which is fast and efficient. PHP and MySQL are both open source software, which promotes sharing code and a stable development environment.

Contrast our environment with the latest .NET environment, where development is very product dependent. As the direction of one corporation turns, so must all developers who embrace that environment. However, the advantages are ease of implementation and the advantage of development benefits produced by an industry giant.

For more info, please read our book, pages 1-7

Print this Page Back To Top

© 2000- 2004 newMANIC INC, All rights reserved