15
Web Server Administration Chapter 7 Installing and Testing a Programming Environment

Web Server Administration Chapter 7 Installing and Testing a Programming Environment

Embed Size (px)

Citation preview

Page 1: Web Server Administration Chapter 7 Installing and Testing a Programming Environment

Web Server Administration

Chapter 7Installing and Testing a

Programming Environment

Page 2: Web Server Administration Chapter 7 Installing and Testing a Programming Environment

Overview Understand the need for

programming languages Understand database management

systems (DBMSs) Install and test DBMSs Understand the Web-based

programming environment Program with databases

Page 3: Web Server Administration Chapter 7 Installing and Testing a Programming Environment

The Need for Programming Languages Web pages with just HTML

statements are static pages Pages that contain programming

statements allow changes and they are called dynamic pages

Programming languages can also be used to update databases and communicate with other systems

Page 4: Web Server Administration Chapter 7 Installing and Testing a Programming Environment

Database Management Systems (DBMSs) The purpose of a DBMS is to store

data in an organized manner for further processing

Structured Query Language (SQL) is the language used to define and manipulate the data

Most databases are relational and organize data into tables

Page 5: Web Server Administration Chapter 7 Installing and Testing a Programming Environment

Database Tables

Page 6: Web Server Administration Chapter 7 Installing and Testing a Programming Environment

Three Categories of SQL Data Manipulation Language (DML)

Used for programming and to insert, update, delete, and retrieve data

Data Definition Language (DDL) Used to create tables and other

related structures in a database Data Control Language (DCL)

Allows you to control access to tables

Page 7: Web Server Administration Chapter 7 Installing and Testing a Programming Environment

Installing and Testing MySQL for Red Hat Linux

As with other applications, you need to install (we already have it installed)

Start MySQL with /etc/rc.d/init.d/mysqld start

The command-line interface is accessed withmysql

Create a password for mysql root account withSET PASSWORD FOR root=PASSWORD('password');

Page 8: Web Server Administration Chapter 7 Installing and Testing a Programming Environment

Login to mysql and Create a Database To login from the shell prompt use mysql –uroot –ppassword

To create a database called hrcreate database hr;

In order to do any operations on the database such as create tables, you have to "use" ituse hr;

Page 9: Web Server Administration Chapter 7 Installing and Testing a Programming Environment

Create Tables and Insert Data

The following script creates the employee table and adds three employees

create table employee (ssn char(9) primary key,firstname varchar(20),lastname varchar(30),deptno char(2),salary numeric(6));

insert into employee values('553879098','Lynn','Gweeny',10,55000);

insert into employee values('623827368','Elark','Kaboom',10,60000);

insert into employee values('756838998','John','Doh',20,45000);

Page 10: Web Server Administration Chapter 7 Installing and Testing a Programming Environment

Web-based Programming Environment Cookie

Text that a Web site stores on your disk Common Gateway Interface (CGI)

A protocol that allows the operating system to interact with the Web server

Practical extraction and reporting language (Perl) First popular language for Web servers

Java Server Pages (JSP) Language similar to Java

Page 11: Web Server Administration Chapter 7 Installing and Testing a Programming Environment

Web-based Programming Environment

Active Server Pages (ASP) Script-based environment available on all IIS

Web servers ASP.NET

Compiled programs operate under .NET Framework

.NET Framework is an integral part of Windows Server 2003 and can be installed on Windows 2000

PHP Hypertext Protocol (PHP) Popular language available on most platforms

The structure of JSP, ASP, and PHP are similar

Page 12: Web Server Administration Chapter 7 Installing and Testing a Programming Environment

Programming with Databases

Program wants to use a database1. Connect to the database2. Send SQL command to the database3. Process data returned by database

Two types of SQL statements Retrieves data – select statement Changes data – insert or delete statement

Page 13: Web Server Administration Chapter 7 Installing and Testing a Programming Environment

Producing a Report Connect to the database Execute a SQL select statement to

retrieve data from a table Loop through the records and

display the contents

Page 14: Web Server Administration Chapter 7 Installing and Testing a Programming Environment

Programming with PHP

Page 15: Web Server Administration Chapter 7 Installing and Testing a Programming Environment

Summary

Programming languages process data, allow you to create dynamic Web pages, and can produce other features

Database management systems organize data for processing