Web Server
Web Server
Web Server
Dr John T. H.Yuen
(Main Reference Chapter 8-9) CYC 306, thyuen@cs.hku.hk 1
CONTENT
Understand:
The flow of an e-commerce website
Static vs dynamic webpage
Customer information
Shopping cart
Email
2
SHOPPING IN E-COMMERCE
delivery
Warehouse
Catalog
Email
display Login Shopping
server
cart
Warehouse
Email Catalog
Login Shopping
server display
cart
Internet
Static HTML pages
with text, pictures,
etc.
Step 1: Request
Step 2: Response
Client (Browser) Web Server 8
PLATFORM NEUTRALITY OF THE WEB
Enable communication of computers using different type of hardware, operating systems, and
software system
Web clients
Different browsers (and additional functions like email handling)
Web servers
Different hardware
Different operating systems
Different http response generation software systems
Require standardization of data format and protocol
9
PLATFORM NEUTRALITY OF THE WEB
Internet
DNS Server
Local Area
Network
(LAN) Client 2: Server 3: IBM
Macbook mainframe +
Apache HTTP
Server
Server 2: Unix
Client 3: OS + Sun Java
iPad System Web
Server 1: Windows
Client 1: Client 4: OS + Microsoft Server
Windows PC Mobile phone Internet Information 10
Server (IIS)
STATIC & DYNAMIC WEBPAGE
The reply page can be generated from 4 different ways Server Side
Scripting .
1.
2. -side scripting)
E.g. CGI (Common Gateway Interface) programs, ASP (Active Server Pages), Java Server Pages (JSP), Servlets, and PHP
(Hypertext Preprocessor).
3. The web server replies a web page, which contains some codes to be executed in the client-side browser
(a.k.a. client-side scripting)
E.g. Applets, Adobe Flash, JavaScripts (JavaScript can also perform server-side scripting, though not so common)
4. The web server executes a program, and the output is a web page, containing some codes to be executed in
the client side
Combination of (2) & (3) needed 11
STATIC WEBPAGE
Internet
Static HTML
pages with text,
pictures, etc.
Step 1: Request
Step 2: Response
Client (Browser) Web Server
Step 1: Request
CGI programs
Step 2: Response
Client (Browser) Web Server
Catalog
database
13
Hands-on practice in Lab 2!
CLIENT-SIDE SCRIPTING USING JAVA APPLETS
Internet
HTML Pages
with applet codes
Step 1: Request
Step 2: Response
Web Server
Browser build-in
e.g. JavaScript + HTML + CSS
Java interpreter
Client (Browser)
14
STATIC VS. DYNAMIC WEBPAGE
Static
l 16
Warehouse
Email Catalog
Login Shopping
server display
cart
Server
Web Browser) lrtpache) < IMYSQH
, , (pµp,
HTTP Response
Firewall
Router FW
Internet
Load logging
Balancer Database
Servers
Web Application
Servers Servers
LAN 1 LAN 2 LAN 3 LAN 4 21
FIREWALL & LOAD BALANCE
Firewall: defer to the security part won't
normally users
see
assigns incoming Web traffic to the server that has the most available capacity.
In a simple load-balancing system, the traffic that enters the site from the Internet, encounters the
load-balancing switch, which then directs the traffic to the Web server best able to handle the traffic
Web Server 1
Web Server 2
23
HOSTING A STATIC PAGE WITHOUT SERVER
static /client
scripting
like bittorrent system
InterPlanetary File System (IPFS) ↳
a peer-to-peer network for storing and sharing data in a
distributed file system.
uses content-addressing to uniquely identify each file in a global
namespace connecting all computing devices.
You can put a static/client side scripting webpage in IPFS
IPFS hash
E.g., upload a index.html file and get a IPFS hash for the file centralized Distributed System
system
Peer distributes its
Open the webpage by the IPFS hash in browser get the own peers .
Warehouse
Email Catalog
Login Shopping
server display
cart
Ace
eq upload files , manage
customer's
File Transfer (for control and other purposes)
.
In case you want to set up your own web By default, web server does not know
server, there are many web servers. programming, i.e., it cannot do any server-side
Two most popular: programming, such as connecting to a database
system, allowing user login/logout, reading PHP,
Apache HTTP Server JSP, ASP, etc. So we need to install modules to let
http://httpd.apache.org/ the web server understand different
Nginx programming languages.
http://nginx.org/ Install PHP module then the web server
understand PHP programs
You can install the above Web Servers in most
of the common operating systems, such as Install JSP module then the web server understand
Windows, Linux, Mac. JSP programs
28
SHOPPING IN E-COMMERCE
delivery
Warehouse
Email Catalog
Login Shopping
server display
cart
31
SHOPPING IN E-COMMERCE
delivery
Warehouse
Email Catalog
Login Shopping
server display
cart
advertising banners
35
FULL-SERVICE, SHARED MALL-STYLE HOSTING (E-MALLS)
Warehouse
Email Catalog
Login Shopping
server display
cart
38
SHOPPING IN E-COMMERCE
delivery
Warehouse
Email Catalog
Login Shopping
server display
cart
Warehouse
Email Catalog
Login Shopping
server display
cart
{
on
the websites trace their users /
45
canbetsaced keep track
for data Arthur sessions
analysis
WEB SERVER AND E-COM SERVER: SUMMARY
delivery
Warehouse
Web server(server view):
Platform Neutrality
newsletter http request
Dynamic page
Multi-tier architecture
Email Catalog
Choosing web server
Login Shopping
server display
cart Choosing database
E-com server(business
processes view):
Web hosting
User authentication
Customer Catalog
Catalog display
Order Warehouse
database database database database Shopping cart
46