Windows Azure

Windows Azure and symfony 1.4 important php.ini settings

When you try to get symfony running (for instance with windowsazure4e) there will occur some problems with the deployed version.

I could solve the problems with these very important php.ini settings:

  • Locate the “cgi.force_redirect” setting and remove the comment and set the value to “0“‘ (Note: 0 for IIS and 1 for Apache or iPlanet).
  • Locate the “cgi.fix_pathinfo” setting and remove the comment. Leave the value as “1” (Note: cgi.fix_pathinfo provides full PATH_INFO/PATH_TRANSLATED support for CGI. Previously the behavior of PHP was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to ignore PATH_INFO. For more information on PATH_INFO, see the cgi specs. Setting this to 1 will cause PHP CGI to fix its paths to conform to the spec.).
  • Locate the “fastcgi.impersonate” setting and remove the comment, leave the value as “1” (Note: FastCGI under IIS supports the ability to impersonate security tokens of the calling client. This allows IIS to define the security context that the request runs under.).
  • Locate “extension_dir” and set it to “ext“.

windowsAzure: Web.config settings

To optimize the performance of my WindowsAzure web role I analysed it with the firefox plugin page speed. To pass the several tests I needed to enhance the following settings.

Leverage browser caching:

      <clientCache httpExpires="Sun, 29 Mar 2020 00:00:00 GMT" cacheControlMode="UseExpires" />

I changed the above setting to:

      <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="1.00:00:00"  />

Because it is strongly not recommend to use high expiration dates, because you can not influence client or proxy cache if the file is already cached. In this example it set it to 1 day.

More Information here.

Specify a Vary: Accept-Encoding header:
		    <remove name="Vary"></remove>
		    <add name="Vary" value="Accept-Encoding"></add>

Also I changed here a little bit:

		    <remove name="Vary"></remove>
		    <add name="Vary" value="Accept-Encoding, Cookie"></add>

Cookie means in this case to use a different cache version for each session.

EDIT: I removed the “Cookie”-Setting again, because it slows down every page request up to 2  Seconds!

More information here.

Enable compression:

      <remove fileExtension=".js" />
      <mimeMap fileExtension=".js" mimeType="text/javascript" />

        directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"
      <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
        <add mimeType="text/*" enabled="true" />
        <add mimeType="message/*" enabled="true" />
        <add mimeType="application/x-javascript" enabled="true" />
        <add mimeType="*/*" enabled="false" />
        <add mimeType="text/*" enabled="true" />
        <add mimeType="message/*" enabled="true" />
        <add mimeType="application/javascript" enabled="true" />
        <add mimeType="*/*" enabled="false" />
    <urlCompression doStaticCompression="true" doDynamicCompression="true" />

Not that httpCompression is already enabled by default, but the default setting for minFileSizeForComp ist 2700kB, so small files will be ignored. Furthermore I disabled the compression for HTTP1.0 and Proxies, because older browser sometime have problems with it.

The modification of the mimeMap is done because of the different mimeTypes for JavaScript, so we give all .js files the same mime type which will be compressed.

WindowsAzure: Remote Desktop

I needed some research to find out how to configure a WindowsAzure web role manually to activate Remote Desktop.

Here are the settings:


     <Import moduleName="RemoteAccess" />
     <Import moduleName="RemoteForwarder" />

Each role of the deployments which needs RDP requires the module “RemoteAccess”. Only one role needs to import the module “RemoteForwarder”.


 <Role name="WorkerRole">
   <Instances count="2" />
     <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
     <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="jimoneil" />
     <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="ENC_PASSWORD" />
     <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="2011-01-27T23:59:59.0000000-05:00" />
    <Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="true" />
     <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption"
                  thumbprintAlgorithm="sha1" />

“RemoteForwarder” only needs to be activiated for the forwarder role. Follow the link below for a generate password how-to. The thumbprint can be found in the management portal.


Copyright © 2007-2012 iTopia. All rights reserved.
Jarrah theme by Templates Next | Powered by WordPress