Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web Servers1-1 Web Servers Xingquan (Hill) Zhu

Similar presentations


Presentation on theme: "Web Servers1-1 Web Servers Xingquan (Hill) Zhu"— Presentation transcript:

1 Web Servers1-1 Web Servers Xingquan (Hill) Zhu xqzhu@cse.fau.edu

2 Web Servers1-2 Outline  Introduction  HTTP Request Type  Web Servers  Microsoft IIS  Apache Web Server  Client-Side Scripting vs Server-Side Scripting  Requesting Documents  PhP

3 Web Servers1-3 Introduction  Web server  Responds to client requests by providing resources  URL (Uniform Resource Locator)  scheme: object-address  Web server and client communicate with platform-independent Hypertext Transfer Protocol (HTTP) http://www.someschool.edu/someDept/pic.gif host name path name

4 Web Servers1-4 Introduction: HTTP HTTP: hypertext transfer protocol  Web’s application layer protocol  client/server model  client: browser that requests, receives, “displays” Web objects  server: Web server sends objects in response to requests PC running Explorer Server running Apache Web server Mac running Navigator HTTP request HTTP response

5 Web Servers1-5 Introduction: HTTP Request Initiate TCP Connection:  a small packet  Hand shaking Request File:  Send HTTP request Persistent vs non-psersistent Keep-alive on/off time to transmit file initiate TCP connection RTT request file RTT file received time GET /somedir/page.html HTTP/1.1 Host: www.someschool.edu User-agent: Mozilla/4.0 Connection: close Accept-language:fr (extra carriage return, line feed)

6 Web Servers1-6 Introduction: HTTP Request Type  Request methods  Get Retrieve and send client form data to Web server Form data is to be encoded (by a browser) into a URL http://www.google.com/search?hl=en&q=FAU&bt nG=Google+Searchhttp://www.google.com/search?hl=en&q=FAU&bt nG=Google+Search 1024 characters  post Post data to a server-side form handle –As data attachment Form data is to appear within a message body Secure

7 Web Servers1-7 Introduction: Web servers

8 Web Servers1-8 Microsoft IIS  FTP Site  Used for transferring large files across the Internet  HTTP Site  Used most frequently to request documents from Web servers  SMTP Virtual Server  Sends and receives electronic mail  Web Site Content Directory  Directory containing the documents that clients will view

9 Web Servers1-9 IIS  General home directory  C:\inetput\wwwroot\  Can be accessed via http://localhost/mydocument.html http://ip.ip.ip.ip/mydocument.html

10 Web Servers1-10 Virtual Directory

11 Web Servers1-11 Virtual Directory

12 Web Servers1-12 Virtual Directory

13 Web Servers1-13 Directory Properties

14 Web Servers1-14 Apache Server  Currently the most popular Web server  Stability  Efficiency  Portability  Open-source Apache Server Installation

15 Web Servers1-15

16 Web Servers1-16 Select “HTTP Server”

17 Web Servers1-17 Select “Download! From a mirror”

18 Web Servers1-18 Select Apache Server 2.0.59 Win32 Binary and download  Save to your local disk Apache_2.0.59-win32-x86-no_ssl.msi

19 Web Servers1-19 Apache Installation

20 Web Servers1-20 Apache installation

21 Web Servers1-21 Apache installation

22 Web Servers1-22 Apache installation

23 Web Servers1-23 Select apache directory

24 Web Servers1-24 Apache Directory

25 Web Servers1-25 Install

26 Web Servers1-26 Done

27 Web Servers1-27 Apache Configuration  Where is it?

28 Web Servers1-28 Configuration: httpd.conf

29 Web Servers1-29 Configuration: httpd.conf  Web address  http://localhost/directory/..  10.20.30.40/directory/start  run  cmd  ipconfig/all  The default directory  Document Root: H:/Program Files/Apache Group/Apache2/hotdocs  http://localhostor http://127.0.0.1/  Aliases  Map a local directory to a web directory  Alias /home "h:/xqzhu/apache/homepage/“  Difference between /home and /home/  Access control  Order Allow and Deny Allow from host host … Deny from host host host … Order allow, denyvs order deny, allow –order allow,deny –allow from 123.156 –deny from all

30 Web Servers1-30 Configuration: httpd.conf  Apply access control to directories Options Indexes Order allow, deny Allow from all -------------------------------------------- Options Indexes Order allow, deny Deny from 127.0.0.1 Allow from all ---------------------------------------------- Options: none, indexes Question? How to publish a web site content directory?

31 Web Servers1-31 Configuration: httpd.conf  UserDir:  The name of the directory that is appended onto a user's home directory if a ~user request is received  On Windows NT UserDir "My Documents/My Website"  DirectoryIndex  sets the file that Apache will serve if a directory is requested. Forbid listing a directory  http://www.cse.fau.edu/~xqzhu  DirectoryIndex index.html goog.html Question again? How to publish a web site content directory? Make sure that you reset the server each time you make the changes

32 Web Servers1-32 Service related parameters: httpd.conf  Listen a specific port  Listen 8080  The number of seconds before receives and sends time out  Timeout 300  Whether or not to allow persistent connections  KeepAlive On  KeepAliveTimeout 15

33 Web Servers1-33 Outline  Introduction  HTTP Request Type  Web Servers  Microsoft IIS  Apache Web Server  Client-Side Scripting vs Server-Side Scripting  Requesting Documents  PhP

34 Web Servers1-34 Client-Side Scripting vs Server- Side Scripting  Client-side scripts (most fancy effects are here, but browser dependent)  Validate user input  Reduce requests needed to be passed to server  Enhance Web pages with DHTML, ActiveX controls, and applets  JavaScript, VBScript, Java Applet  There are many things client-side scripts cannot do…  Server-side scripts (file and database access)  Executed on server  Generate custom response for clients  Wide range of programmatic capabilities  Functionality  PHP (Hypertext Preprocessor), ASP (Active Server Pages), JSP (Java Server Pages)

35 Web Servers1-35 Requesting Documents  Requesting five different documents  XHTML  ASP.NET  Perl  PHP  Python http://localhost/home/php/myphp.php

36 Web Servers1-36 PHP  Server must install PHP  Must lead Apache to find the PHP, in case there is a need to interpret PHP script  Binding PhP with Apache Server  PHP Installation  Configuration

37 Web Servers1-37 PHP

38 Web Servers1-38 Download windows binaries 5.1.6 PHP 5.1.6 zip package

39 Web Servers1-39 Unzip the file to a local directory, say h:/php

40 Web Servers1-40 Change php.ini-recommended  Change php.ini-recommended to php.ini  php.ini is the configuration file of PHP

41 Web Servers1-41 Let Apache know where PHP is  Open httpd.conf (Apache configuration)  Find out “#PhP module”  Add following two lines below “# LoadModule”  LoadModule php5_module "h:/php/php5apache2.dll“  AddType application/x-httpd-php.php  Then you are basically good to go  http://localhost/home/php/form.html

42 Web Servers1-42 Php.ini configuration  Show all errors  error_reporting = E_ALL  The separator used in PHP generated URLs  Default “&”  arg_separator.output = "&"  Separator(s) used by PHP to parse input URLs  Default “&”  arg_separator.input = ";&"  Whether to allow HTTP file upload  file_uploads = On  Temporary directory for HTTP file upload  upload_tmp_dir =“directory”  Numerous features related to PHP, will be addressed at later stage

43 Web Servers1-43 Pluto server  Directly put xxx.php file under any directory you like, Pluto has PhP already.  http://student.cse.fau.edu/~yourid/cop3813/h w6/myphp.php  How to program PhP?

44 Web Servers1-44 Outline  Introduction  HTTP Request Type  Web Servers  Microsoft IIS  Apache Web Server  Client-Side Scripting vs Server-Side Scripting  Requesting Documents  PhP


Download ppt "Web Servers1-1 Web Servers Xingquan (Hill) Zhu"

Similar presentations


Ads by Google