SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu !...

24
SEEM3490 Information Systems Management Lecture 02 – Web Information System I Objectives In these three lectures, our objectives are: Understand, setup and manage web server Understand, setup and manage file server Understand, setup and manage database server Copyright (c) 2012. Gabriel Fung. All rights reserved.

Transcript of SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu !...

Page 1: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

SEEM3490 Information Systems Management Lecture 02 – Web Information System I

Objectives

!   In these three lectures, our objectives are: !   Understand, setup and manage web server

!   Understand, setup and manage file server

!   Understand, setup and manage database server

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 2: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

Why Study Them?

!   A simple case: !   A tuition school wants to have a computerized point of sales

(POS) system.

!   It is has 3 different centers

!   Its daily operation is …

!   Its requirement is …

Copyright (c) 2012. Gabriel Fung. All rights reserved.

General Architecture

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Shatin Center

TST Center

Wan Chai Center

Web server (with programming ability)

Database server

Access via the Internet

Page 3: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

Terminologies

!   Server !   A server is a system (software and hardware) that responds to

requests across a computer network to provide, or help to provide, a service. !   E.g., a web server provides service for delivering web pages, a mail

server provides service for sending and receiving email, etc.

!   A computer can provides many services simultaneously, i.e., a computer can have several servers running at the same time. !   E.g., we can install web server, file server, database server, email

server, print server in a single computer.

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Hardware for Servers

!   Usually, CPU speed is not quite as critical to a server as it is to a desktop machine. !   Certainly, it cannot be too slow, and always faster the better.

!   Fast network connections and high I/O throughout are relatively more important.

!   Since servers are usually accessed over a network, they may run in headless mode without a monitor or input device. Processes that are not needed for the server's function are not used.

!   Many servers do not have a graphical user interface (GUI) as it is unnecessary and consumes resources that could be allocated elsewhere. Similarly, audio and USB interfaces may be omitted.

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 4: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

ECC Memory

!   Electrical or magnetic interference inside a computer system (such as radiation) may change the contents of a memory cell (i.e., RAM). !   In 2009, Schroeder et al. (University of Toronto) reported that a

32% chance that a given computer in their study would suffer from at least one correctable error per year.

!   In 2010, Li et al. (Rochester University) gave evidence that a substantial fraction of memory errors are intermittent hard errors.

!   In 2011, Nightingale et al. (Microsoft) reported that on non-ECC RAM in PCs and laptops, about 26% for the total memory of a computer would have a memory error per 8 months.

Copyright (c) 2012. Gabriel Fung. All rights reserved.

ECC Memory (cont'd)

!   This problem can be remedy by using redundant memory bits and memory controllers that exploit these bits.

!   These extra bits are used to record parity and to enable missing data to be reconstructed by error-correcting code (ECC).

!   An ECC-capable memory controller as used in many modern PCs can typically detect and correct errors of a single bit per 64-bit word (a word has 8 byte. A Byte has 8 bits), and detect (but not correct) errors of two bits per 64-bit word.

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 5: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

ECC Memory (cont'd)

!   But ECC Memory are more expensive…

Copyright (c) 2012. Gabriel Fung. All rights reserved.

World Wide Web

!   In 1989 Tim Berners-Lee proposed a new project to his employer CERN, with the goal of exchanging information between scientists more efficiently by using a hypertext system. Two programs resulted in 1990: !   A browser called World Wide Web.

!   A web server called CERN httpd !   Ran on NeXTSTEP

!   Note: !   CERN

! Conseil Européen pour la Recherche Nucléaire (European Council for Nuclear Research). Now renamed as European Organization for Nuclear Research.

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 6: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

Hypertext

!   Theodor Holm Nelson (Ted Nelson) originally invented the word "hypertext” in 60s and later developed a system called Xanadu !   Hypertext is text displayed on a computer display or other

electronic devices with references (hyperlinks) to other text which the reader can immediately access,

!   The goal of Xanadu is to create a computer network with a simple user interface. The effort is documented in his 1974 book Computer Lib / Dream Machines and the 1981 Literary Machines.

!   The project was being terminated in 90s.

Copyright (c) 2012. Gabriel Fung. All rights reserved.

World Wide Web (cont'd)

!   Between 1991 and 1994, the simplicity and effectiveness of early technologies used to exchange data through the World Wide Web (remember: it is the name of the browser) helped to port them to many different operating systems and spread their use among scientific organizations and universities, and then to industry.

!   In 1994, Tim Berners-Lee decided to constitute the World Wide Web Consortium (W3C) to regulate the further development of the many technologies involved (HTTP, HTML, etc.) through a standardization process.

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 7: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

World Wide Web (cont'd)

!   Up to now, can you guess why a web site address (URL) usually begins with “www”?

Copyright (c) 2012. Gabriel Fung. All rights reserved.

About HTTP

!   HTTP - HyperText Transfer Protocol

!   In computer communication, computers are communicated via some predefined “protocols”. There are many “Protocols”. !   FTP, SMTP, TCP, IP, …

!   Each protocol has its own characteristic

!   For simplicity, you can imagine a protocol just like a language. If two persons have to talk with each other, they must use the same language. There are many languages: !   Chinese, English, Japanese, Spanish, …

!   Each language has its own grammar

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 8: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

About Data Communication

Copyright (c) 2012. Gabriel Fung. All rights reserved.

ticket (purchase) baggage (check) gates (load) runway (takeoff) airplane routing

departure airport

arrival airport

intermediate air-traffic control centers

airplane routing

ticket (complain) baggage (claim) gates (unload) runway (land) airplane routing

!   Let’s consider for how we take an airplane trip

Data Communication (cont’d)

!   Sending a piece of data is similar to ask the piece of data to take a trip from one place to another place!

!   This is known as “Layered Architecture”

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Application Transport Network Data Link Physical

Your Computer Target Computer Via Different Routers

Physical

Application Transport Network Data Link Physical

Page 9: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

Data Communication (cont’d)

!   When we send a message, we usually have to decompose a message and add "header" and "trailer".

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Message

Header T Trailer T Message 1

Message 1 Header T Trailer T Header N Trailer N

Message 1 Header T Trailer T Header N Trailer N Header L Trailer L

Message 1 Message 2 Message 3 … decompose Message

Segment

Datagram

Frame

Application Transport Network Data Link Physical

Message

segment

datagram

frame

frame routing

Layered Architecture

!   Many models proposed!

!   The model that we used in the previous slides is "TCP/IP Protocol Suite".

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 10: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

Layered Architecture (cont’d)

!   Application Layer – Support network applications !   Web – HTTP (Hyper Text Transfer Protocol)

!   Email – SMTP (Simple Mail Transfer Protocol)

!   File Transfer – FTP (File Transfer Protocol)

!   Transport Layer – Host-to-host data transfer !   TCP – Transmission Control Protocol (Reliable)

!   UDP – User Datagram Protocol (Non-Reliable)

!   SCTP – Stream Control Transmission Protocol

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Layered Architecture (cont'd)

!   Network Layer – Route datagram from source to destination !   Internet Protocol (IP) Address (like your home address)

!   Logical address (e.g., 127.0.0.1) – Identify the physical location of the computer

!   In CUHK domain, all computers are: 137.189.xxx.xxx

!   Media Access Control (MAC) Address (like your student ID) !   Physical address – The identity of the network card !   ALL network card in the world have different MAC Address!!! (IEEE

standard – 224 combinations, i.e. 281474976710656)

!   Link Layer – Data transfer between neighboring network elements !   Point to Point Protocol (PPP)

!   Physical Layer – Bits on the wire

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 11: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

Telnet

!   Telnet is a network protocol used on the Internet or local area networks to provide a bidirectional interactive text-oriented communication facility using a virtual terminal connection. !   It uses Transmission Control Protocol (TCP) for

communication.

!   Note: !   Telnet does not encrypt any data sent over the connection!

!   Use mainly for testing of only.

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Demo – Request a Web Page

!   Open a terminal, type: !   telnet www.se.cuhk.edu.hk 80

!   GET /index.php

!   “80” in this example is called “port”. You can imagine a port is the same as a gate in an airport. !   There are totally 65535 ports. Default: HTTP – 80, HTTPS –

443; SMTP – 25; …

Page 12: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

More About Xanadu

! Xanadu and WWW are similar in terms of both can share information efficiently

!   Yes, they are different in terms of “how the information is shared”. !   As Nelson stated:

!   “HTML is precisely what we were trying to PREVENT— ever-breaking links, links going outward only, quotes you can't follow to their origins, no version management, no rights management.”

!   Some further explanation from another scientist (Jaron Lanier): !   “A core technical difference between a Nelsonian network and what

we have become familiar with online is that [Nelson's] network links were two-way instead of one-way. In a network with two-way links, each node knows what other nodes are linked to it. ... Two-way linking would preserve context.”

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Web Server

!   The primary function of a web server is to deliver web pages. The communication between client and server takes place using the Hypertext Transfer Protocol (HTTP).

!   Note: !   Web servers are not always used for serving the Internet. They

can also be found embedded in devices such as printers, routers, webcams and serving only a local network. !   The web server may then be used as a part of a system for

monitoring and/or administering the device in question. This usually means that no additional software has to be installed on the client computer, since only a web browser is required.

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 13: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

Web Server (cont'd)

!   Note: !   A web server by default do not have any programming ability

!   Yet, we need programming ability usually !   E.g., we may need to interact with a database management system

!   There are two ways to "obtain" a web server: !   Find a third party company which will setup everything for you

!   Usually regarded as "web hosting company", simply "hosting company"

!   Set up a web server yourself

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Find a Hosting Company

!   Two types of hosting companies: !   Paid

!   E.g., Yahoo, GoDaddy, NameCheap, etc.

!   Free !   E.g., http://www.free-webhosts.com/

!   A story (a real one): !   I have put every thing into a free hosting company

!   The company suddenly disappeared when I wake up one day…

!   Everything is gone…

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 14: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

Find a Hosting Company (cont'd)

!   When choosing a hosting company, some general question you need to ask (at least): !   What kind of programming language it supports? (PHP? JSP?)

!   How to upload file to the web server?

!   What is the underlying operating system? (Windows? Linux? Unix?)

!   What kind of database it supports? (MySQL? Oracle? Sybase? DB2?)

!   What kind of server it is running? (Apache? Microsoft IIS?)

!   What is the maximum single file size for upload/download?

!   What is the maximum total bandwidth?

!   What is the speed?

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Find a Hosting Company (cont'd)

!   Where is the server? !   Some countries may block some servers in some locations…

!   The reputation of the server? !   This is extremely useful for sending and receiving emails.

!   Most hosting companies also provides email services, i.e., they have set up both web servers and email servers.

!   You may not send email out successfully if the email server has bad reputation!

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 15: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

Setup a Web Server

!   We may want to set up our own web server.

!   There are many web servers. Two most popular: !   Apache HTTP Server

! http://httpd.apache.org/

! Nginx ! http://nginx.org/

!   You can install the above Web Servers in most of the common operating systems, such as Windows, Linux, Mac.

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Setup a Web Server (cont'd)

!   We may change a web server to have programming ability (i.e., server side programming) by installing modules !   Install PHP module so that the Web Server understand PHP

programs

!   Install JSP module so that the Web Server understand JSP programs

!   Note: !   If you want to write ASP program, you must install Microsoft IIS

Server (a kind of web server), because ASP is developed by Microsoft, and only Microsoft IIS can run ASP programs. There are no “ASP module” for Apache or Nginx.

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 16: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

Web Server Case Study

!   In the following slides, I will use my Mac Computer to demonstrate how to set up a web server using Apache. Other operation system will be very similar.

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Mac OS X

!   Every Mac computer has Apache HTTP Server and PHP Module installed already !   What you need to do is to enable it!

!   Many ways to enable: !   Use a GUI:

!   http://clickontyler.com/virtualhostx/

!   Set up yourself via command prompt: !   Many online tutorials. Search in YouTube!

!   http://www.youtube.com/watch?v=3UOXIEWqPCw

!   http://www.youtube.com/watch?v=iIZ1gfDjjL0

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 17: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

Mac OS X (cont'd)

!   We try to enable the Apache HTTP Server and PHP module via Terminal: !   Application > Utility > Terminal:

Mac – Enable Apache HTTP Server

!   To enable/start/restart Apache HTTP Server !   cd /private/etc/apache2

!   "cd" means "change directory to"

! sudo apachectl graceful !   "sudo" means "superuser do". You need to be a superuser whenever

you try to edit system files. Enter your Mac administrator password when prompted. !   To avoid typing "sudo" whenever you modify a system file, you can type

"sudo su –" so that all commands thereafter will belong to "superuser"

!   "apachectl" means "apache control center"

!   "graceful" is a command to restart the server !   http://httpd.apache.org/docs/2.2/stopping.html

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 18: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

Mac – Enable Apache HTTP Server (cont'd)

!   You can now: !   http://127.0.0.1/~XXXX/

!   http://localhost/~XXXX/

to see the contents of whatever is stored in the user ~/Sites/ directory.

!   E.g., http://localhost/~gabriel/

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Mac – Enable Apache HTTP Server (cont'd)

!   Some advanced settings: !   Host tables

!   Edit the file in: /etc/hosts

!   Virtual Host !   Edit the file in: /etc/apache2/extra/http-vhosts.conf

!   Note: !   You need to restart Apache HTTP Server whenever changes are made

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 19: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

Mac – Enable PHP

!   First narrow down the Apache configuration directory: ! sudo su –

!   cd /etc/apache2

!   Backup the original configuration:

! cp httpd.conf httpd.conf.bak

!   "cp" means "copy" so you copy "httpd.conf" to "httpd.conf.bak"

!   Now open the configuration file in an editor: ! pico httpd.conf

!   "pico" is a text editor. Some others are "vi" and "vim".

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Mac – Enable PHP (cont'd)

!   Edit the file: !   Identify the line (around line 115):

!   #LoadModule php5_module libexec/apache2/libphp5.so

!   And change to (remove the #): ! LoadModule php5_module libexec/apache2/libphp5.so

!   Save the file and exit !   Press Ctrl–X

!   Now the PHP module is added to the Apache Web Server. !   Next, we need to configure PHP

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 20: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

Mac – Enable PHP (cont'd)

!   To use the default setting of PHP, in terminal: !   cd /etc

! cp php.ini.default php.ini

!   Now, everything is ready. Restart Apache now: ! apachectl graceful

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Mac – Some References

!   http://jason.pureconcepts.net/2012/10/install-apache-php-mysql-mac-os-x/

!   http://osxdaily.com/2012/09/02/start-apache-web-server-mac-os-x/

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 21: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

Windows – Enable Apache HTTP Server

!   For Windows, what you need to do is to download the Apache HTTP Server and install it! !   http://httpd.apache.org/download.cgi

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Windows – Enable Apache HTTP Server (cont'd)

!   Where is my server?

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 22: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

Windows – Enable Apache HTTP Server (cont'd)

!   Put the document in the correct location

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Windows – Enable Apache HTTP Server (cont'd)

!   To start Apache HTTP Server

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 23: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

Windows – Enable PHP

!   Before you download and install… ! Make sure you have ALREADY INSTALLED Apache Web

Server! (or other kinds of web servers)

!   After that… !   Go to www.php.net and download/install the latest version!

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Viewing Your Site

!   You can also view your web site in your own computer by:

http://localhost

http://127.0.0.1

!   You can view it anytime once your started your Apache HTTP Web Server !   Even you are not connected to the Internet

!   But only you can view it

!   It is usually used for the purpose of debugging only

Copyright (c) 2012. Gabriel Fung. All rights reserved.

Page 24: SEEM3490 Information Systems Managementseem3490/slides/lecture02.pptx.pdf · More About Xanadu ! Xanadu and WWW are similar in terms of both can share information efficiently ! Yes,

Viewing Your Site (cont'd)

!   Connect your computer to the Internet, then you may check the IP Address of your computer from: !   http://www.checkip.org/

!   After that you can properly view your web site in any computer! !   Suppose your IP address is: 130.102.50.11

!   And you have put your index.html in the folder “htdocs”

!   Then, in your browser, type:

!   http://130.102.50.11/index.html

Copyright (c) 2012. Gabriel Fung. All rights reserved.