Hooman nili - PowerPoint PPT Presentation

1 / 33
About This Presentation
Title:

Hooman nili

Description:

The browser and the server talk thro. HTTP. Name-based Web serving (In this case Apache-again! ... Sending emails thro. Web sites. Client-side scripting ... – PowerPoint PPT presentation

Number of Views:295
Avg rating:3.0/5.0
Slides: 34
Provided by: clintea
Category:
Tags: hooman | nili | thro

less

Transcript and Presenter's Notes

Title: Hooman nili


1
The WWW Part 2 an introduction to
clientserver-sidetechnologies
Hooman nili
2
The WWW Part 2 an introduction to
clientserver-sidetechnologies
Hooman nili
3
Background
  • What is a Web server? A web server is a software
    that uses the client/server model to server web
    pages.

4
Background
What is a Web server? Essentially, a web
server, as a piece of software, needs to be
installed and configured on a machine (server
hardware) before it can do anything. Once
installed and configured, the operating system
can then open a specific network port for the web
server before it can respond to any HTTP
requests. (This is the most common practical
approach)
5
Background
What is a Web server? The default port number
for web servers is 80. A web server thats ready
to respond to HTTP requests is said to be
listening on port 80 (if thats the port number
its been allocated to) It is possible to
allocate a port number other than 80 to a web
server. It is also possible to run more than
one web server on a the same machine (aka
host/node)
6
Background
What is a Web server? Most web servers can
respond to many simultaneous client requests.
The client is usually a web browser, but it
could be any HTTP client application e.g. web
crawlers, or even an interactive Telnet session.
The resource request is always made using some
version of the HTTP typically to send the
contents of file stored (hosted) on the server.
7
Background
  • The architecture of web service
  • (In this case Apache)

8
Background
What is a Web server? Although the web servers
main purpose is to retrieve information from a
central storage, todays web servers are capable
of performing other tasks as well. Before
transferring a file (resource), most web servers
can instruct the client how to interpret or
format the resource. Web servers can perform user
authentication, data encryption as well as
facilitating database access on clients behalf.
9
How?
  • The Web browser sends a request for a web
    page.
  • The Web server receives (if) a request for a
    web page. e.g www.pdldold.com
  • The Web server then maps the URL to a
    local file on the host server.
  • The server then loads this file from disk
    and serves it out across the network to the
    Web browser.
  • The browser and the server talk thro. HTTP.

10
Name-based Web serving (In this case
Apache-again!)
11
How ?
  • When a web server like Apache (HTTP 1.1)
    receives a request from a client (browser) it
    will generally perform one of the following
    actions
  • It will either respond to the request by serving
    a document (resource) or
  • refuse to respond to the request followed by a
    numeric status code indicating why the particular
    resource could not be served. In this case, a
    numeric status code between 300-399, means the
    server is redirecting the request to an
    alternative location

12
HTTP Com. TCP/IP layers (DoD)
TCP
TCP
IP
IP
13
Some popular Web servers
14
How popular?
March 2004 Web Server Survey www.netcraft.co.uk
(also www.securityspace.com )
15
How popular?
March 2003 Web Server Survey
Top Developers - Recent

16
How popular?
March 2007 Web Server Survey www.netcraft.co.uk
(also www.securityspace.com )
17
How popular?
2003 vs 2007
18
How popular?
Market Share for Top Servers Across All Domains
August 1995 - July 2009
19
What is a Web scripting Language?
  • Web scripting languages enable Web developersto
    create dynamic Web pages which can respond to
    viewers behaviours.
  • Examples
  • Checking browsers settings (e.g. cookies)
  • Authentication /Access restriction
  • Shopping carts
  • Sending emails thro. Web sites.

20
Client-side scripting
  • In client-side scripting, we totally rely on the
    users browser to interpret and execute the
    code.
  • JavaScript is the de facto for client-side
    scripting.
  • In client-side scripting the requested file (web
    page) is saved to the browsers cache and is
    executed from the local hard disk.

21
Sever-side scripting
  • In server-side scripting, we mainly (90 ) rely
    on the Web server to execute the code.
  • Sever-side scripting provides the means for
    database access.
  • Its usually more flexible, especially with
    respect to databases. We can generate
    customised replies, and interfaces for viewers.

22
How server-side works
Server
Response
parser or script engine

HTML

HTML with server-side scripts
Client
Request
23
Popular server-side tools
  • ASP Active Sever PagesFile extension .asp
  • Developed by Microsoft, can be programmed in a
    variety of scripting languages such as VBScript,
    JavaScript, JScript, etc.
  • Runs mainly on IIS (Internet Information
    Services)
  • Talks to databases like Access, MS SQL.

24
Popular server-side tools ...
  • Perl Practical Extraction and Report
    LanguageFile extension .pl
  • Written by Larry Wall in 1987, its a high-level
    scripting (some say programming) language.
  • Widely used on the Web and runs on many
    operating systems.
  • On the Web, its usually incorporated in the
    Common Gateway Interface (CGI).
  • Its free

25
Popular server-side tools
  • PHP PHP Hypertext PreprocessorFile extensions
    .php, .php3, .php4, .phtml
  • Originally stood for Personal Home Page, and
    developed by Rasmus Lerdorf in 1994
  • Its considered as ASPs counterpart by many
    developers.
  • Talks to virtually all databases, but most
    often is used with MySQL (Free).
  • Works with virtually all Web servers.
  • Its free and open.

26
Popular server-side tools
  • CGI Common Gateway InterfaceFile extensions ?
  • Its a method for connecting web pages to the
    programs or scripts running on the server to
    which visitors would have limited access.
  • CGI applications can be written in a variety of
    languages including Perl, C, Java, and VB.
  • Its supported on virtually all web servers.
  • CGI is NOT a programming language itself.

27
Examples
Say Hello in ASP lt_at_ languageVBScript
gt lthtmlgt ltheadgtlttitlegtHello ASPlt/titlegt lt/headgt lt
bodygt lt Response.Write(Hello ASP) gt lt date
gt ltbrgt lt time gt lt/bodygt lt/htmlgt
28
Examples
Say Hello in PHP lthtmlgt ltheadgt lttitlegtHello
PHPlt/titlegt lt/headgt ltbodygt lt? echo "lth2gtHello
PHPlt/h2gt" ?gt lt/bodygt lt/htmlgt
29
Examples
Say Hello in Perl !/usr/bin/perl Print HTTP
header (\n is newline character) print
"Content-type text/html\n\n" Print start of
HTML page. print "lthtmlgt\nltbodygt\n" Store
Hello World in a the string message (\n denotes a
new line). my message "Hello World" Print
hello world ten times. for (1..10) print
message Print end of HTML page. print
"lt/bodygt\nlt/htmlgt\n"
30
Examples
  • Say Hello and show date using CGI
  • First a link in a web page
  • lta href../cgi-bin/hellogtHello CGIlt/agt
  • Now a shell script running on the server
  • !/bin/sh
  • echo Content-type text/plain
  • echo
  • echo Hello CGI
  • echo
  • /bin/date

31
Resources
  • ASP/IIS http//www.microsoft.com
  • PHP http//www.php.net
  • Apache http//www.apache.org
  • MySQL http//www.mysql.com
  • Perl http//www.perl.com

32
Discussion Time
  • Server-side or client-side?
  • To Microsoft or Not Microsoft? thats the
    question!
  • Apache or IIS? (Windows or Unix?)
  • ASP or PHP?
  • What is ASP.NET?
  • Difference between ASP.NET and ASP
  • Open Source

33
Discussion Time.
  • PHP vs ASP.NET
  • Will .NET dictate the future of web
    applications?
  • PHP is interpreted, but .NET is complied.
    Correct? Which is faster?
  • Object Orientated Programming. PHP and ASP.NET
  • Difference between ASP.NET and ASP
  • IS ASP.NET better than PHP for business web
    appz? (corporate support, etc)
Write a Comment
User Comments (0)
About PowerShow.com