php apache vs iis by hafedh yahmadi

41
palais des congrès Tunis 8 et 9 février 2012

Upload: techdaystunisia

Post on 17-May-2015

2.010 views

Category:

Technology


5 download

TRANSCRIPT

Page 1: Php apache vs iis  By Hafedh Yahmadi

palais des congrès Tunis

8 et 9 février 2012

Page 2: Php apache vs iis  By Hafedh Yahmadi

PHP / APACHE & MICROSOFT

Yahmadi Hafedh – DPE Microsoft Tunisie

Présentateur
Commentaires de présentation
le theme de cette session entre dans le cadre des tracks de l’Interoperabilité qui est un axe strategique pour Microsoft. L’interoprabilité chez Microsoft est strategique PROCAS (Produit, Collaboration, Access, et Standard)
Page 3: Php apache vs iis  By Hafedh Yahmadi

Agenda

1. PHP for Windows Qu’est ce que PHP ? Que peut Faire PHP ? Windows IIS avec PHP. Demo

2. Web Server (IIS & Apache) 3. IIS features in details 4. Case Study + demo 5. PHP on the Cloud 6. Conclusion

Présentateur
Commentaires de présentation
PHP est un langage simple tant dans sa syntaxe que dans ses fonctions. Il faut connaître le HTML
Page 4: Php apache vs iis  By Hafedh Yahmadi

Titre 1

Introduction

PHP For Windows 1

Page 5: Php apache vs iis  By Hafedh Yahmadi

What is PHP? PHP stands for "PHP

Hypertext Preprocessor” An embedded scripting

language for HTML like ASP or JSP

A language that combines elements of Perl, C, and Java

History of PHP Created by Rasmus Lerdorf in

1995 for tracking access to his resume

Originally a set of Perl scripts known as the “Personal Home Page” tools

Rewritten in C with database functionality

Qu’est ce que PHP?

Présentateur
Commentaires de présentation
Qu'est ce que PHP? Au debut PHP - "Personal Home Page – initié par un danois autour des scripts perl pour mintenir sa page web. PHP (officiellement, est un acronyme récursif pour PHP: Hypertext Preprocessor) est un langage de scripts généraliste et Open Source, spécialement conçu pour le développement d'applications web. Il peut être intégré facilement au HTML. PHP est un acronyme récursif, qui signifie "PHP: Hypertext Preprocessor" : c'est un langage de script HTML, exécuté côté serveur. Sa syntaxe est empruntée aux langages C, Java et Perl, et est facile à apprendre. Le but de ce langage est de permettre aux développeurs web d'écrire des pages dynamiques rapidement, mais vous pouvez faire beaucoup plus avec PHP. Au lieu d'utiliser des tonnes de commandes afin d'afficher du HTML (comme en C ou en Perl), les pages PHP contiennent des fragments HTML dont du code qui fait "quelque chose" (dans ce cas, il va afficher "Bonjour, je suis un script PHP !"). Le code PHP est inclus entre une balise de début <?php et une balise de fin ?> qui permettent au serveur web de passer en mode PHP. Ce qui distingue PHP des langages de script comme le Javascript, est que le code est exécuté sur le serveur, générant ainsi le HTML, qui sera ensuite envoyé au client. Le client ne reçoit que le résultat du script, sans aucun moyen d'avoir accès au code qui a produit ce résultat. Vous pouvez configurer votre serveur web afin qu'il analyse tous vos fichiers HTML comme des fichiers PHP. Ainsi, il n'y a aucun moyen de distinguer les pages qui sont produites dynamiquement des pages statiques. Le grand avantage de PHP est qu'il est extrêmement simple pour les néophytes, mais offre des fonctionnalités avancées pour les experts. Ne craignez pas de lire la longue liste de fonctionnalités PHP. Vous pouvez vous plonger dans le code, et en quelques instants, écrire des scripts simples. Bien que le développement de PHP soit orienté vers la programmation pour les sites web, vous pouvez en faire bien d'autres usages. Lisez donc la section Que peut faire PHP ? ou bien le tutoriel d'introduction si vous êtes uniquement intéressé dans la programmation web. Added a forms interpreter and released as PHP/FI: includes Perl-like variables, and HTML embedded syntax.
Page 6: Php apache vs iis  By Hafedh Yahmadi

PHP is used by 77.2% of all the websites whose server-side programming language we know.

PHP 77.2% ASP.NET 21.7% Java 4.1% ColdFusion 1.2% Perl 1.0% Ruby 0.6% Python 0.3%

W3Techs.com, 6 Dec 2011

This Table shows the percentages of websites using various versions of PHP.

Version 5 94%

Version 4 06%

Version 3 Less than 0.1%

Version 6 Less than 0.1%

W3Techs.com, 6 Dec 2011

Présentateur
Commentaires de présentation
C’est la communauté forte des utilisateurs PHP qui interesse Microsoft Microsoft investit enermement pour cette communauté.
Page 7: Php apache vs iis  By Hafedh Yahmadi

The Script Tags All PHP code is contained in

one of several script tags: <?

// Some code ?>

<?php // Some code here ?>

The Script Tags (cont.) <script language=“PHP">

// Some code here </script>

ASP-style tags Introduced in 3.0; <% // Some code here %>

PHP Language Basics

Page 8: Php apache vs iis  By Hafedh Yahmadi

1. Sites Web et applications Web (script côté serveur)

2. Scripts en ligne de commande

3. Ecrire Applications à interface graphique (GUI)

C'est l'utilisation la plus traditionnelle. Ecrire des scripts PHP et l'exécuter en ligne de commande (Cron) PHP-GTK

Que peut Faire PHP ?

Page 9: Php apache vs iis  By Hafedh Yahmadi

Code Portability The obvious: don’t use Unix or

Windows specific functions Create a reusable module for file

system differences, for example: • if( PHP_OS == "Linux" )

{ $ConfigPath = "/var/www/conf"; $DataPath = "/var/www/data"; }

Code Portability if( ereg("WIN", PHP_OS) )

{ $ApachePath = “C:/Program Files/Apache Group/Apache”; $ConfigPath = ”$ApachePath/htdocs/conf"; $DataPath = "$ApachePath/htdocs/data"; }

PHP on Linux and Windows (Portability OS, WebServer, OOP, Protocol, BD)

Présentateur
Commentaires de présentation
  http://www.microsoft.com/web/platform/phponwindows.aspx
Page 10: Php apache vs iis  By Hafedh Yahmadi

DEMO

Donwload PHPonWindows&SQLServerTrainingKit

from http://www.microsoft.com/download/en/details.aspx?id=8887

PHP Installer from : http://Windows.php.net

Page 11: Php apache vs iis  By Hafedh Yahmadi

Titre 1

PHP For Windows

Web Server (IIS & Apache) 2 Durant des decencies Apache Foundation et Microsoft dominent les servers web shares

Page 12: Php apache vs iis  By Hafedh Yahmadi

IIS 3.0 in option in Windows NT 4.0 IIS 5.0 was included in Windows 2000 in both server and Desktop IIS 5.1 part of XP Windows Server 2003 includes the new IIS 6.0 Windows Server 2008 (R2) includes IIS7.5

Internet Information Server

Page 13: Php apache vs iis  By Hafedh Yahmadi

Free web server. Often combined with Linux, MySQL, and PHP to make the LAMP stack. First released in 1995. Modular architecture. Built using an open source development model. Commercial friendly open-source license. Current stable Version is 2.2.22 which was released in 31 January 2012

APACHE Overview

Page 14: Php apache vs iis  By Hafedh Yahmadi

Proven Scalability and Stability Used by many major sites

and companies such as MySpace.com, Match.com, US Bank, USA Today, Allstate, Continental Airlines and others.

Significant increase in reliability of hosted web sites compared to IIS 5.0.

A solid trusted foundation for IIS 7.0

IIS 6.0 – A Solid Foundation Shipped with Windows

Server 2003 Proven Security

Significant reduction in attack surface compared to previous releases

IIS 6 Overview

Page 15: Php apache vs iis  By Hafedh Yahmadi

IIS7 Overview Benefits Features

Modular and Extensible Integrated with .NET Improved Security Agile Administration Built in Request

Tracing

Reduced Attack Surface

Easier to Manage Fast Diagnostics

Extend/Modify IIS Features

Create Streamlined

Servers

IIS 7 Overview

Page 16: Php apache vs iis  By Hafedh Yahmadi

Titre 1

PHP For Windows

IIS Features in details 3

Page 17: Php apache vs iis  By Hafedh Yahmadi

Questions “Which of the two platforms (IIS and Apache)

is more secure?”

“Which is easier to manage?”

“Is Apache or IIS easier to manage?”

“Which web server is more reliable?”

“Which is more modular, IIS or Apache?”

“Is IIS or Apache more innovative?”

“Is IIS or Apache easier to troubleshoot?”

“Does Apache support more applications?”

“Does IIS or Apache have the lower TCO?”

“Is Apache the best platform for PHP Applications?”

Page 18: Php apache vs iis  By Hafedh Yahmadi

IIS / Security Development Lifecycle Automatic Update Patching Security Tracking – Secunia

IIS 7.0 Security Minimal Surface Area Automatic Site / Application

Sandboxing Anonymous User Account

Changes URL Authorization Built in Request Filtering Integrated Active Directory

Authorization

Security

Page 19: Php apache vs iis  By Hafedh Yahmadi

IIS 7.0 Manageability Centralized Web Farm

Configuration Streamlined and Focused

Administration Tool Remote Administration Tool Command Line

Administration Rapid Troubleshooting and

Limited Downtime

Management

Présentateur
Commentaires de présentation
Page 20: Php apache vs iis  By Hafedh Yahmadi

Enterprise Level Performance “Match.com runs IIS 7.0 with

30 million page views daily.” “PlentyOffFish.com gets 1.2

billion page views a month.” “WS2008 and IIS 7.0 allow

www.microsoft.com to process 122 million more requests at the same CPU level – compared to IIS 6.0”

“MySpace.com runs IIS 7.0 with 23 billion page views a month.”

IIS 7.0 Performance/Scalability Leaner Web Servers Server Core Static and Dynamic

Compression Output Caching

Improvements

Performance / Scalability

Page 21: Php apache vs iis  By Hafedh Yahmadi

IIS 7.0 Modularity Server functionality is split

into 40 modules Only 10 modules installed

by default Modules and a Generic

Pipeline Extensibility

IIS 7.0 Reliability Proven and Trusted Platform

54% of the Fortune 1000 rely on IIS 7.0

Rapid diagnostics tools to troubleshoot any concerns quickly Failed Request Tracing Runtime State and Control

API.

Reliability / Modularity

Présentateur
Commentaires de présentation
Page 22: Php apache vs iis  By Hafedh Yahmadi

IIS 7.0 Innovation IIS 7.0 Admin Pack URL Rewrite Module

(Technical Preview) PowerShell Provider for IIS Remote Manager – IIS 7 UI

for Down-level Clients Web Playlists

Innovation

Présentateur
Commentaires de présentation
Page 23: Php apache vs iis  By Hafedh Yahmadi

IIS 7.0 Troubleshooting Detailed Error Messages

Verbose Error Messages Suggests Causes and

Solutions Details include

configuration sections in question, modules in use, page, etc.

Failed Request Tracing Allows for custom

failure criteria per URL Persist Failure Log Files

beyond process lifetime Common Usages

Request take too long

Request Error (completes but with error code)

Troubleshooting

Page 24: Php apache vs iis  By Hafedh Yahmadi

IIS 7.0 Application Support Extensible, modular architecture

– add, remove or replace any built-in module

Enhanced ASP.NET integration including unified configuration, HTTP runtime and administration tools

Caching support (kernel and user) for all types of dynamic content

Built-in FastCGI support for Open Source frameworks such as PHP and Ruby.

Strong integration with other Enterprise Products such as SharePoint

Extensive Support for Streaming Media

Application Support

Page 25: Php apache vs iis  By Hafedh Yahmadi

IIS 7.0 - Cost of Ownership Rapid Troubleshooting and

Minimized Downtime Minimized Surface Area Isolation and Sandboxing Scalable Multi-Tenant

Hosting

Less Expensive Administrator Resources to Maintain

Delegated Control to Site Owners

Strong Microsoft Support Resources

TCO

Page 26: Php apache vs iis  By Hafedh Yahmadi

IIS 7.0 and PHP Support Consolidate .NET and PHP

applications on a single server Consolidate Web and Other Server

Management Frameworks to a single platform

Better Web Platform Management

Host on Minimal / Headless Server with Server Core

Powerful Media Serving Microsoft Supported Solution

PHP Applications

Présentateur
Commentaires de présentation
Page 27: Php apache vs iis  By Hafedh Yahmadi

IIS 7.0 has: A Modular and Extensible

Architecture Deep integration with .NET

Applications Improved Security Agile Administration Built in Troubleshooting Tools

such as Request Tracing

This leads to a Web Platform that is: Streamlined Easy to extend To Manage Quick to Troubleshoot Highly Secure

Summary

Page 28: Php apache vs iis  By Hafedh Yahmadi

Titre 1

PHP For Windows

Case Study + demo 4

Page 29: Php apache vs iis  By Hafedh Yahmadi

Titre 1

Windows Azure Platform + PHP

PHP ON The Cloud 5

Page 30: Php apache vs iis  By Hafedh Yahmadi

Introducing the Windows Azure Platform

Présentateur
Commentaires de présentation
Page 31: Php apache vs iis  By Hafedh Yahmadi

Private (On-Premise)

Infrastructure (as a Service)

Platform (as a Service)

Types of Clouds

Storage

Server HW

Networking

Servers

Databases

Virtualization

Runtimes

Applications

Security & Integration

Storage

Server HW

Networking

Servers

Databases

Virtualization

Runtimes

Applications

Security & Integration

Storage

Server HW

Networking

Servers

Databases

Virtualization

Runtimes

Applications

Security & Integration

You

man

age M

anaged by vendor

Managed by vendo

Yo

u m

anag

e

You

man

age

Page 32: Php apache vs iis  By Hafedh Yahmadi

Private (On-Premise)

Types of Clouds Infrastructure

(as a Service) Platform

(as a Service)

Page 33: Php apache vs iis  By Hafedh Yahmadi

Windows Azure for Application Developers

Portal Hosted Service

Storage

SDK

Develop Deploy Run

Page 34: Php apache vs iis  By Hafedh Yahmadi

Windows Azure Compute Roles

Role

Code Configuration

Page 35: Php apache vs iis  By Hafedh Yahmadi

Web vs. Worker Role Web Role

IIS Host

Your Code

Worker Role

System Host

Your Code

Page 36: Php apache vs iis  By Hafedh Yahmadi

Sample Application Architecture

http://yourapp.cloudapp.net

Page 37: Php apache vs iis  By Hafedh Yahmadi

Running PHP in Windows SDK for PHP @ http://phpazure.codeplex.com How to Do It Host in Web role (like .NET) Supply PHP runtime Point to runtime via FastCGI

configuration in Web.config Web.roleconfig

PHP Web Role Instance 2

VI P

Load

Ba

lanc

er

PHP Web Role Instance 1

Page 38: Php apache vs iis  By Hafedh Yahmadi

This is all you need! \HelloCloudPHP

ServiceDefinition.csdef ServiceConfiguration.cscfg \WebRole web.roleconfig web.config \php index.php <your php application> etc...

Make sure you change your php.ini to use relative paths!

Page 39: Php apache vs iis  By Hafedh Yahmadi

PHP with SQL Azure SQL Server Driver for PHP @

http://sqlsrvphp.codeplex.com/

Supports PHP access to SQL Azure

Features Choose between SQL Server and SQL Azure by changing

connection string Use from on-premises or in Windows Azure

Page 40: Php apache vs iis  By Hafedh Yahmadi

Lastly, Microsoft can help your company! BizSpark www.bizspark.com

For startups

Less than 3 years old Less than USD 1M in annual revenue Must make software product or service

You get a bunch of free stuff (software,

support, visibility)

Free Windows Azure usage (up to a certain limit)

WebsiteSpark www.websitespark.com

For companies that build web sites and

applications for their customers Less than 10 employees

You get a bunch of free stuff (software,

support, visibility)

No Windows Azure usage unfortunately…

Page 41: Php apache vs iis  By Hafedh Yahmadi

Titre 1 MERCI

ND E