Deployment - Sales Dashboard using AppFabric SDK for PHP

Prerequisites
Demo Installation Guide
  1. If you haven't already done so, Download and configure the AppFabric SDK for PHP Developers.


  2. Links to download SDK


  3. Download and extract dotnetservicesphp-v1.0-sample.zip.This will create following five folders
    1. Clientapp
    2. database
    3. iisrewrite
    4. PollingService
    5. SalesDashboardService

  4. Client application folder structure


  5. The Demo requires a service namespace, management key, issuer key, policy key and claims to be created on azure. The following steps explain how to create a service namespace, keys and claims on azure:
    1. Login to AppFabric Devloper Portal using your live ID.
    2. Create a project by specifying a name e.g. PHPAppFabric.
    3. Once the project is created, Click on the project name to navigate to the project information Page.


    4. Project_information
    5. Click on 'Add Service Namespace' to create a new service namespace, give name e.g. appfabricsdkphp

    6. service_namespace_creation
    7. Once the service namespace is created, click on the 'Service Namespace' name to navigate to the service namespace information page.
    8. In this page you can see information such as Management key, service bus and access control end points.

    9. service_namepapce_info
    10. To create issuer key and policy key, download and install Windows Azure platform AppFabric SDK.
    11. Go to C:\Program Files\Windows Azure platform AppFabric SDK\V1.0\Tools, Update the Acm.exe.config file,with service namespace and management key.

    12. acm.exe.config
    13. Copy and paste SetUpSalesDashBoard.cmd to C:\Program Files\Windows Azure platform AppFabric SDK\V1.0\Samples \AccessControl\GettingStarted\ASPNETStringReverser
    14. From the command prompt run SetUpSalesDashBoard.cmd, this script will ask for your service namespace name and management key

    15. SetUpSalesDashBoard

      This script will create and display the issuer key and policy key, notedown these keys. This script also creates required claims for the SalesDashBoard application.
  6. Enable gd2 extension in php.ini file
    • To enable gd2, search for 'extension=php_gd2.dll' in the php.ini file and remove the semicolon (;) in front.
  7. Follow the instructions listed below to configure the RESTful SalesDashboard Service:
    1. Create a MySQL database with name infocorp, use the MySQL script \database\infocorp.sql to create required tables with data in this database
    2. Set following parameters present in config.php file placed under SalesDashboardService\config folder as per your configuration.
      1. Define the database configuration settings as described below
        • MySQL server name as DB_HOST. e.g. "localhost"
        • MySQL user name as DB_USER. e.g. "root"
        • MySQL password as DB_PASS
        • MySQL database name as DB_DBNAME. e.g. "infocorp"

      2. Define the AppFabric settings as described below:
        • Set value of ACS_TRUSTED_SERVICE as AppFabric service namespace e.g. "appfabricsdkphp"
        • Set value of ACS_TRUSTED_AUDIENCE as "http://localhost/SalesDashboard/"
        • Set value of ACS_TRUSTED_SIGNING_KEY as the policy key step 3.j

    3. service_config

  8.  Follow the instructions listed below to configure the SalesDashboard client application:
    1. Set following parameters present in config.inc file placed under \Clientapp\includes\ folder as per your configuration.
      1. Define the proxy settings as described below:
        • HTTP Proxy Host Name
          define("PROXY_HOST", "127.0.0.1");
        • HTTP Proxy Port Number
          define("PROXY_PORT", "80");
        • HTTP Proxy username
          define(“HTTP_PROXY_USER”, "");
        • HTTP Proxy Password
          define("PROXY_PASSWORD", "");

      2. Define the AppFabric Service Bus settings as described below:
        • Set value of ISSUER_NAME as "owner"
        • Set value of ISSUER_SECRET_KEY as management key in step 3.f
        • Set the value of SERVICE_NAMESPACE_DOMAIN as your service namespace ex:appfabricsdkphp
        • Set the value of MESSAGE_BUFFER_NAME as "salesopphp"
        • Set the value of SCOPE_APPLIES_TO as  "http://localhost/SalesDashboard/"
        • Set the value of HOST_NAME as url to the RESTful Sales Dashboard Service, refer step 7.d e.g. http://localhost:8086

  9. client_config


  10. Follow the instruction below to set up the SalesDashboard service and Client application:
    1. Open login.php file in \Clientapp\view folder, search for the text "txtPassword" and set your issuer key (from step 3.j) as the value of "value" attribute.
      login.php
    2. Copy-paste the Web.config file in \iisrewrite to the \Clientapp folder
    3. Copy-Paste the SalesDashBoardService folder to \Clientapp folder
    4. Create a web site with name SalesDashBoard [e.g. on port 8086] using the contents of \Clientapp. To know more about how to configure a new website on IIS, please refer here
  11. Follow the instructions listed below to configure the Polling Service
    1. Open the command prompt and change the current directory to the PollingService folder and run the polling service as a stand-alone service using following command:
      C:\inetpub\www\html\PollingService> php intermediateService.php

    2. To stop the polling service, open the command prompt and change the current directory to the PollingService folder and run following command:
      C:\inetpub\www\html\PollingService> php intermediateService.php stop

  12. Open browser and browse to http://localhost:8086

    login.php