1 / 44

Web Servers Xingquan (Hill) Zhu xqzhu@cse.fau

Web Servers Xingquan (Hill) Zhu xqzhu@cse.fau.edu. Outline. Introduction HTTP Request Type Web Servers Microsoft IIS Apache Web Server Client-Side Scripting vs Server-Side Scripting Requesting Documents PhP. Introduction. Web server Responds to client requests by providing resources

Download Presentation

Web Servers Xingquan (Hill) Zhu xqzhu@cse.fau

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web ServersXingquan (Hill) Zhuxqzhu@cse.fau.edu Web Servers

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

  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 path name host name Web Servers

  4. 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 Introduction: HTTP HTTP request PC running Explorer HTTP response HTTP request Server running Apache Web server HTTP response Mac running Navigator Web Servers

  5. initiate TCP connection RTT request file time to transmit file RTT file received time time Introduction: HTTP Request Initiate TCP Connection: • a small packet • Hand shaking Request File: • Send HTTP request Persistent vs non-psersistent Keep-alive on/off 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) Web Servers

  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&btnG=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 Web Servers

  7. Introduction: Web servers Web Servers

  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 Web Servers

  9. General home directory • C:\inetput\wwwroot\ • Can be accessed via • http://localhost/mydocument.html • http://ip.ip.ip.ip/mydocument.html IIS Web Servers

  10. Virtual Directory Web Servers

  11. Virtual Directory Web Servers

  12. Virtual Directory Web Servers

  13. Directory Properties Web Servers

  14. Apache Server • Currently the most popular Web server • Stability • Efficiency • Portability • Open-source Apache Server Installation Web Servers

  15. Web Servers

  16. Select “HTTP Server” Web Servers

  17. Select “Download! From a mirror” Web Servers

  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 Web Servers

  19. Apache Installation Web Servers

  20. Apache installation Web Servers

  21. Apache installation Web Servers

  22. Apache installation Web Servers

  23. Select apache directory Web Servers

  24. Apache Directory Web Servers

  25. Install Web Servers

  26. Done Web Servers

  27. Apache Configuration • Where is it? Web Servers

  28. Configuration: httpd.conf Web Servers

  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://localhost or 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, deny vs order deny, allow • order allow,deny • allow from 123.156 • deny from all Web Servers

  30. Configuration: httpd.conf • Apply access control to directories <Directory "H:/xqzhu/apache/homepage/"> Options Indexes Order allow, deny Allow from all </Directory> -------------------------------------------- <Directory "d:/apache/test/"> Options Indexes Order allow, deny Deny from 127.0.0.1 Allow from all </Directory> ---------------------------------------------- Options: none, indexes Question? How to publish a web site content directory? Web Servers

  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 Web Servers

  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 Web Servers

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

  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) Web Servers

  35. Requesting Documents • Requesting five different documents • XHTML • ASP.NET • Perl • PHP • Python http://localhost/home/php/myphp.php Web Servers

  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 Web Servers

  37. PHP Web Servers

  38. Download windows binaries 5.1.6PHP 5.1.6 zip package Web Servers

  39. Unzip the file to a local directory, say h:/php Web Servers

  40. Change php.ini-recommended • Change php.ini-recommended to php.ini • php.ini is the configuration file of PHP Web Servers

  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 Web Servers

  42. Php.ini configuration • Show all errors • error_reporting = E_ALL • The separator used in PHP generated URLs • Default “&” • arg_separator.output = "&amp;" • 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 Web Servers

  43. Pluto server • Directly put xxx.php file under any directory you like, Pluto has PhP already. • http://student.cse.fau.edu/~yourid/cop3813/hw6/myphp.php • How to program PhP? Web Servers

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

More Related