1 / 66

กรณีศึกษาการ Interoperability Software ที่พัฒนาโดย PHP กับ IIS7 บน Windows Web Server

กรณีศึกษาการ Interoperability Software ที่พัฒนาโดย PHP กับ IIS7 บน Windows Web Server. เสรี ชิโนดม seree@buu.ac.th. Agenda. PHP on Windows IIS 7 .0 Core Architecture FastCGI on IIS 7.0 Best practices and patterns Demo Web Application (e-Office). PHP on Windows.

lynsey
Download Presentation

กรณีศึกษาการ Interoperability Software ที่พัฒนาโดย PHP กับ IIS7 บน Windows Web Server

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. กรณีศึกษาการ Interoperability Software ที่พัฒนาโดย PHP กับ IIS7 บน Windows Web Server เสรี ชิโนดม seree@buu.ac.th

  2. Agenda • PHP on Windows • IIS7.0 Core Architecture • FastCGI on IIS 7.0 • Best practices and patterns • Demo Web Application (e-Office)

  3. PHP on Windows What’s the difference between PHP on Windows and Linux Why I run PHP on Windows !

  4. Why you might Run PHP on Windows The PHP Ecosystem Applications, Applications, Applications…… Open source designs Loose and Wild The PHP community contributes to a variety of defacto standard facilities to connect everything Zend and the PHP community are invested in Windows Specific PHP technology.

  5. Some Favorite PHP Applications PHP-Nuke PostNuke RunCMS Mambo Xoops MyPHPAdmin PHPBB2 VBulletin VBPortal cPanel Drupal e107 MD-Pro MyPHPNuke PHPWebSite TikiWiki Typo3 Xaraya b2Evolution bBlog Serendipity WordPress TextPattern OSCommerce OSCNuke Zen Cart eGroupWare phpGroupWare Site@School ATutor Moodle Segue Coppermine QwikiWikki SugarCRM WebCalendar

  6. Potential Advantages to running PHP on Windows. Windows Ecosystem Over 600,000 partners in the Microsoft Ecosystem. Microsoft makes MUCH more than Windows Microsoft is making huge investments interoperability standards and technologies. (WS-I, etc.) Microsoft provides …. a complete turn-key infrastructure …. Individual best-of-breed applications for you to choose from FUTURE TECHNOLOGIES

  7. Software Options from Microsoft MS Access MS Outlook BizTalk SQL Server MS LCS Identity Integration Server MS Excel PowerPoint SharePoint SQL RS Business Manager ISA Server MS FrontPage MS Project MS CMS SQL AS Virtual Earth Data Analyzer MS InfoPath Small Business Accounting Exchange Server SQL NS Messenger MS Mobile Live Meeting MS Visio Commerce Server Project Server MapPoint Tablet PC MS OneNote MS Word MS CRM MOM App Center MS Starter Kits

  8. More Software Options from Microsoft Active Directory IIS 6/7 Axapta Navision Info Bridge Media Center ADAM MSMQ Great Plains Retail Management WSH Info Card Authorization Manager Windows Server 2003 Small Business Manager Windows Unix Services DirectX WinFX Operations Manager Windows Mobile MS Solomon VBA / VSA ActiveX Windows Workflow MS Enterprise Reporting XML-WS WSE Application Center MSN Search Hosted Controls Presentation Foundation (Avalon) Windows Embedded Windows Media Server System Management Server Windows Index Server Host Integration Server Vista Longhorn

  9. PHP on Windows PHP Developers work on Windows machines anyway. PHP is PHP is PHP. Zend offers the Winabler. Other 3rd parties offer……. Phalanger = Managed Code PHP http://www.php-compiler.net/ Zend’s Windows Work Continues

  10. PHP On Windows What’s the problem anyway. CGI on Windows ? The PHP ISAPI Extension Will it get fixed ?

  11. PHP on Windows FASTCGI ! PHP on IIS 6 PHP Versions…. Why choose ? PHP on IIS 7 New application context ?

  12. IIS 7.0 Core Architecture

  13. Worker Process Worker Process Worker Process Worker Process Worker Process ISAPI Extensions ISAPI Extensions ISAPI Extensions ISAPI Extensions ISAPI Extensions ISAPI Filters ISAPI Filters ISAPI Filters ISAPI Filters ISAPI Filters IIS6 Architecture Refresher Web garden (w3wp.exe) Application Pool (w3wp.exe) Svchost.exe Inetinfo.exe IIS Admin Service WWW Service (w3svc) Lsass.exe FTP Service Windows Authentication SMTP Service SSL metabase NNTP Service Winsock HTTPAPI User Kernel HTTP.SYS TCPIP.SYS

  14. Worker Process Worker Process Worker Process Worker Process Worker Process ISAPI Extensions ISAPI Extensions ISAPI Extensions ISAPI Extensions ISAPI Extensions ISAPI Filters ISAPI Filters ISAPI Filters ISAPI Filters ISAPI Filters IIS7 Architecture Overview Configuration (applicationhost.config) Web garden (w3wp.exe) Application Pool (w3wp.exe) Managed Mods Managed Mods Managed Mods Svchost.exe Inetinfo.exe IIS Admin Service WAS Lsass.exe FTP Service Windows Authentication WWW Service (w3svc) SMTP Service SSL metabase NNTP Service Winsock HTTPAPI User Kernel HTTP.SYS TCPIP.SYS

  15. IHttpHandlers IIS6 Request flow refresher • Server is monolithic:cant extend core featurescant remove core featurescant add features • Feature duplication between IIS and ASP.NET. • Features limited due to position in pipeline. • ASP.NET functionality not applied to IIS content types. w3wp.exe iiscore aspnet_isapi.dll handlers cgi static file ISAPI exts IHttpModule Events url map begin req determine handler auth’c req logging auth’z req custom errors Svchost.exe w3svc compression resolve cache end req authentication handler map update req cache ISAPI Filter Notifications handler exec rel req state url map log auth’c req Trace.axd PageHandler End net session Pre-proc headers http.sys

  16. other native modules other managed modules basicauth url auth’z digest auth role mgr IHttpHandlers windows auth forms auth IIS7 Architecture W3wp.exe • Unified request processing pipeline. • All services provided by self-contained modules • Modules can be managed or native • All services can apply to all requests Native or Managed Handlers iiscore aspnet_isapi Native Handler Managed IHttpHandler static file isapi ext *.aspx trace.axd IHttpModule Events handlers url map cgi static file Isapi exts Integrated pipeline begin req Native Module IHttpModule end auth’c req log Determinehandler update cache auth’z req WAS w3svc Svchost.exe Isapi filter notifications release state resolve cache end req execute handler url map log handler map update req cache pre-execute handler acquire state handler exec rel reqstate auth’c req End net session map handler resolve cache authorize Pre-proc headers Trace.axd *.aspx authenticate begin User Kernel http.sys Tcpip.sys

  17. Module breakdown A full description of all IIS7 modules is covered in the following tables, they have been broken down in to groups based on functionality: Caching Modules Compression Modules Content Modules Authentication Modules Security Modules Logging & Error Modules Diagnostics Modules Development Modules IIS 7.0 Managed Modules

  18. Development Modules Development technologies offered as to execute code from that platform Implements Managed Interfaces, etc.

  19. New Modular Architecture The integrated pipeline Native Managed Managed - or - Compress Errors Logging Custom Cache Tracing ISAPI FastCGI ASP Static ASP.NET Basic Forms UrlAuth Anon

  20. Integrated pipeline • Unified request processing pipeline for both native and managed (ASP.NET) modules • All modules can provide services for all content types. • You can use ASP.NET forms authentication and url authorization to protect all content on the server • You can develop an ASP.NET module to append custom headers to static file requests. • Duplicate features unified • You can configure authorization, caching, and custom errors in one place. • Managed modules have full ordering flexibility • Managed modules can be intermixed with native modules as desired

  21. IIS7 Modularity

  22. Hosting PHP on Windows

  23. A History of PHP on IIS CGI FastCGI ISAPI Invokes a process for each request. Advantages Easy to Configure Stable Execution Disadvantages Slow due to I/O Overhead of Process Creation Extension to CGI allowing reuse of a process. Advantages Easy to Configure Faster than CGI More stable than PHP on ISAPI Can run non- thread-safe versions of PHP Loaded as extension in process. Advantages Better Performance Disadvantages Many PHP Applications are not Thread-Safe

  24. FastCGI Design Goals • What is FastCGI : • A language and server independent, scalable, open extension to CGI that provides high performance and persistence • A protocol for data interchange between a web server and a FastCGI application • The set of libraries that implement the protocol • Developed by Open Market in 96 as open solution (www.fastcgi.com) • Design goals: • Speed! • Eliminate CGI’s weaknesses • Scalable • Persistent • Build on CGI’s strengths • Simple, Open Standard with an easy migration path • Server, Language, & OS independent • Server Isolation

  25. FastCGI Handle Architecture FastCGI process pool for PHP5 IIS Worker Process FastCGI protocol over named pipes or TCP php-cgi.exe FastCGI process pool for PHP4 Request queue php.exe

  26. FastCGI Handler 1 : Receiving requests in IIS WP 2 : Queieing requests 3 : Dispacthing and receiving response from FastCGI process 4 : Creating one or more FastCGI App Process

  27. FastCGI Handler • Mapping the FastCGI handler to process requests • Processing all URLs in a directory • Response buffering • 64 bit support • Process Management • Create configured FastCGI application processes when needed. • Maintain a connection with each FastCGI application process during its lifetime • Monitor health of FastCGI application processes • Periodically recycle FastCGI processes • Detect when FastCGI processes exited / crashed, and recover gracefully • Terminate FastCGI processes • Queuing and request dispatching • Security model

  28. Initialization Request processing FastCGI Roles Error handling Errors during FastCGI handler initialization Errors during application initialization Request processing errors Rapid Failure Protection FastCGI Protocol Support

  29. FastCGI Roles • Responder • The fundamental FastCGI role • Functionally identical to CGI • Supported by all FastCGI capable servers • Authorizer • Provides a means of controlling access to a site, a page, or something in between • Typically, this involves some form of authentication, but this isn’t required • It has server dependent significance • Filter • Allows “processing” of a file before it is sent • Intended to support: • Format conversions • Dynamic documents (embedded code) • Applying templates: e.g. headers, footers, backgrounds • Conceptually this could support dynamic content chaining, but without server support has limited utility

  30. FastCGI for IIS6 • Same FastCGI functionality as in IIS7, available as a separate download for IIS6 from the Microsoft download center • http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1521 • Fully supported by Microsoft • Walk-throughs demonstrating how to run popular PHP applications on Windows Server • See http://www.iis.net/php • Close collaboration with Zend Technologies • Improvements in PHP engine for IIS with contributions and collaboration back to PHP Community • Zend Core Available for Commercially Supported PHP

  31. FastCGI in IIS6 and IIS7

  32. Advantages of PHP on IIS7 Modular architecture for reduced attack surface XML-based configuration system Remote management capability Advanced diagnostics Integration with WMS and Media Pack Ability to extend IIS7 using managed code • PHP users who deployed to Apache in the past will be more comfortable with IIS7 than IIS6 due to the new configuration system and modular architecture.

  33. New Configuration System Say goodbye to the metabase • Configuration stored in XML files validated by a schema. Schema describes configuration settings for IIS, ASP.NET and 3rd party applications. Schema Central configuration file for the server contains system wide configuration settings. applicationHost.config Distributed configuration files contain overrides and local site and application settings. web.config web.config

  34. New IIS Manager Easy navigation to server, sites and applications Tasks organized by areas and features Common actions related to navigation context

  35. Leveraging the Platform • Rich functionality in IIS7 • Included modules such as Membership • Add-on modules from http://IIS.net • SQL Server 2005 Driver for PHP • Other Windows Applications • Active Directory • Exchange • SharePoint • Office

  36. SQL Server 2005 Driver for PHP • Goal: Provide robust, scalable, and reliable SQL Server connectivity for PHP developers targeting the Windows platform • Enterprise “abilities” to PHP/SQL Server Devs. • Reliability • Scalability • Maintainability • Base the PHP driver's API on existing data patterns • For more info, see the team blog http://blogs.msdn.com/sqlphp

  37. Web application e-Office demo

  38. ระบบสำนักงานไร้กระดาษ (e-Office) โดย สำนักคอมพิวเตอร์ มหาวิทยาลัยบูรพา

  39. หัวข้อการนำเสนอ • ที่มาของโครงการ • วัตถุประสงค์โครงการ • ระบบสารบรรณอิเล็กทรอนิกส์ • ระบบลาอิเล็กทรอนิกส์ • ระบบประชุมอิเล็กทรอนิกส์ • ระบบภาระงานอิเล็กทรอนิกส์ • ระบบแบบสอบถามออนไลน์ • การติดตั้ง PHP กับ IIS7 • วิธีการปรับแต่ง MySQL ใน windows • การติดตั้งโปรแกรม • กราฟแสดงความสามารถในการทำงานของ IIS7

  40. ที่มาของโครงการ • สำนักงานบริหารเทคโนโลยีสารสนเทศเพื่อพัฒนาการศึกษา ได้สนับสนุนโครงการวิจัยการพัฒนาต้นแบบโปรแกรมสำนักงานไร้กระดาษ (e-Office) โดยใช้ซอฟต์แวร์ Open Source

  41. วัตถุประสงค์โครงการ • เพื่อเป็นการสนับสนุนและส่งเสริมการพัฒนาโปรแกรมโดยใช้ซอฟต์แวร์ Open Source • เพื่อเป็นการลดค่าใช้จ่ายและงบประมาณแผ่นดินสำหรับการพัฒนาซอฟต์แวร์สำนักงาน • เพื่อเป็นการปรับกระบวนการปฏิบัติงานภายในสำนักงาน โดยดำเนินการผ่านระบบคอมพิวเตอร์และเครือข่ายอินเทอร์เน็ต ส่งผลให้มีการลดขั้นตอนการทำงาน และลดงบประมาณที่สิ้นเปลืองไปกับกระดาษ • เพื่อเพิ่มช่องทางในการสื่อสารระหว่างบุคลากรภายในสำนักงาน และใช้เป็นสื่อกลางในการเผยแพร่ข้อมูลข่าวสารต่างๆ ที่มีประโยชน์ผ่านทางเว็บไซต์

  42. ระบบสารบรรณอิเล็กทรอนิกส์ระบบสารบรรณอิเล็กทรอนิกส์ • การลงทะเบียนหนังสือ • การขออนุมัติหนังสือ • การส่ง/เวียนหนังสือ • การตรวจสอบสถานะหนังสือ • ตารางนัดหมายส่วนบุคคล • ตารางนัดหมายผู้อื่น • ปฏิทินกิจกรรมสำหรับหน่วยงานและส่วนบุคคล

  43. ระบบลาอิเล็กทรอนิกส์ • การจัดทำใบลาประเภทต่างๆ ผ่านระบบ • การอนุมัติใบลาผ่านระบบ • ตรวจสอบสถานะใบลา • การคำนวณวันลาสะสม • การกำหนดวันที่ห้ามลา • การกำหนดวันหยุดขององค์กร • รายงานสรุปการลา

  44. ระบบประชุมอิเล็กทรอนิกส์ระบบประชุมอิเล็กทรอนิกส์ • จัดทำระเบียบวาระและเอกสารแนบสำหรับการประชุม • จัดทำฐานข้อมูลผู้เข้าร่วมประชุม • จัดการดำเนินการประชุม • จัดทำรายงานการประชุม • จัดทำระบบสอบถามกำหนดการประชุมและตรวจสอบข้อมูลย้อนหลัง • จัดทำรายงานสรุปการประชุมต่างๆ • การจองห้องประชุม

  45. ระบบภาระงานอิเล็กทรอนิกส์ระบบภาระงานอิเล็กทรอนิกส์ • การมอบหมายงานผ่านระบบ • การเก็บข้อมูลภาระงานของบุคลากรภายในหน่วยงาน • การรายงานความก้าวหน้าของภาระงานของบุคลากรภายในหน่วยงาน • ประเมินผลการปฏิบัติงานของบุคลากร

  46. ระบบแบบสอบถามออนไลน์ • การจัดทำประเภทคำถาม • การจัดทำคำถามตามประเภทต่างๆ • การจัดทำแบบสอบถาม • การทำแบบสอบถามออนไลน์ผ่านระบบ • การสรุปผลการทำแบบสอบถาม

  47. การติดตั้ง PHP กับ IIS7 • การติดตั้ง PHP กับ IIS7 ผ่าน Module Fast CGI • ทำได้โดยเลือก server manager แล้วทำการเลือกที่ Role • เลือก Web Server และทำการเลือก Add Role Service

  48. การติดตั้ง PHP กับ IIS7 (ต่อ) • เลือก CGI แล้วเลือกปุ่ม Next

More Related