Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Commit

Permalink
updating environment page with content
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxC4 committed Jul 15, 2014
1 parent 9f44514 commit 02e7d68
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 15 deletions.
3 changes: 3 additions & 0 deletions _includes/html-alert-dynamic-ip-restriction.md
@@ -0,0 +1,3 @@
<div class="alert alert-info">
The full documentation on the <a href="http://www.iis.net/configreference/system.webserver/security/dynamicipsecurity">&lt;dynamicIpSecurity&gt; element</a> is available on IIS Configuration Reference.
</div>
3 changes: 3 additions & 0 deletions _includes/html-alert-ip-security-docs.md
@@ -0,0 +1,3 @@
<div class="alert alert-info">
The full documentation on the <a href="http://www.iis.net/configreference/system.webserver/security/ipsecurity">&lt;ipSecurity&gt; element</a> is available on IIS Configuration Reference.
</div>
70 changes: 70 additions & 0 deletions _posts/01-01-02-Environment.md
Expand Up @@ -14,16 +14,86 @@ Some applications, however, may not require session affinity and it would be bet

##Filtering Traffic by IP

Based on your web application, you may want to restrict access to it. Access can be restricted by using the `<ipSecurity>` element and providing a list of IP address to allow.

{% include html-alert-ip-security-docs.md %}

{% gist SyntaxC4/0d7185b30acf477c2033 web.ipsecurity.config %}

##Dynamic IP Restrictions

Dynamic IP Restrictions enable you to block access to your website when based on an interval of requests (i.e. Potential DDoS Attack). This can be achieved in a variety of ways as outlined in the example below.

{% include html-alert-dynamic-ip-restriction.md %}

{% gist SyntaxC4/0d7185b30acf477c2033 web.dipr.config %}

<noscript>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<security>
<!-- Full Dynamic IP Restriction Documentation: http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-dynamic-ip-address-restrictions -->
<dynamicIpSecurity> <!-- Change status code by adding the attribute: denyAction="[AbortRequest | Forbidden | NotFound | Unauthorized]" -->
<!-- Scenario #1: Deny by Concurrent Requests -->
<denyByConcurrentRequests enabled="true" maxConcurrentRequests="10"/>
<!-- Scenario #2: Deny by Request Rate -->
<denyByRequestRate enabled="true" maxRequests="10" requestIntervalInMilliseconds="2000"/>
<!-- Scenario #3: Combine Deny by Request Rate & Deny by Concurrent Requests -->
</dynamicIpSecurity>
</security>
</system.webServer>
</configuration>
</pre>
</noscript>

##Auto-Heal

You know those bugs where the only way to fix them is to restart the server every so often? There's a `web.config` setting for that! Microsoft Azure Websites have the ability to auto-heal based on a number of different triggers, i've outlined some of them in the example below.

{% gist SyntaxC4/0d7185b30acf477c2033 web.autoheal.config %}

<noscript>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<monitoring>
<triggers>
<!-- Scenario #1: Recycling based on Request Count -->
<requests count="1000" timeInterval="00:10:00"/>
<!-- Scenario #2: Recycling based on slow requests -->
<slowRequests timeTaken="00:00:45" count="20" timeInterval="00:02:00" />
<!-- Scenario #3: Logging an event (or recycling) based on HTTP status code(s) -->
<statusCode>
<add statusCode="500" subStatusCode="100" win32StatusCode="0" count="10" timeInterval="00:00:30"/>
</statusCode>
<!-- Scenario #4: Taking custom actions (or recycling/logging) based on memory limit -->
<memory privateBytesInKB="800000"/>
</triggers>
<!-- Scenario #1 & #2 Action -->
<actions value="Recycle"/>
<!-- Scenario #3 Action -->
<actions value="LogEvent"/>
<!-- Scenario #4 Action -->
<actions value="CustomAction">
<customAction exe="d:\home\procdump.exe" parameters="-accepteula w3wp d:\home\w3wp_PID_%1%_" />
</actions>
</monitoring>
</system.webServer>
</configuration>
</pre>
</noscript>

##HTTP Compression

Some big wins come in small packages, enabling HTTP Compression in your Website can help decrease your users mobile bill and wait time while loading your Web Application.

{% gist SyntaxC4/0d7185b30acf477c2033 web.httpcompression.config %}

<noscript>
<pre>

</pre>
</noscript>
20 changes: 5 additions & 15 deletions _posts/03-04-01-Language-Guide-PHP.md
Expand Up @@ -23,37 +23,27 @@ In order to do this there are a few steps involved:
1. Download the <abbr title="Non Thread Safe">NTS</abbr> PHP runtime
* From [PHP for Windows downloads](http://windows.php.net/downloads) page and upload to ```/site/wwwroot/bin/php``` via <abbr title="File Transfer Protocol">FTP</abbr>.
* Using [KuduExec](#kuduexec) or [KuduExec (Web)](#kuduexec-web)
<pre>
cd site\wwwroot
mkdir bin
cd bin
mkdir php
curl -o php.zip http://windows.php.net/downloads/releases/php-5.5.2-nts-Win32-VC11-x86.zip
unzip php.zip
rm php.zip
</pre>

{% gist SyntaxC4/0d7185b30acf477c2033 InstallPHP.sh %}

2. Configure an Handler Mapping via the Microsoft Azure Management Portal; or
* Login to the Microsoft Azure Management Portal
* Select your Web Site from the list
* Navigate to the **CONFIGURE** tab
* Scroll to the **Handler Mappings** section
* Flll the boxes as follows:

{% include html-php-http-handler-mapping.md %}

3. Configure a Handler Mapping via the command line:

**Cross Platform Command Line Tools**

<pre>azure site handler add '*.php' 'D:\home\site\wwwroot\bin\php\php-cgi.exe'</pre>
{% gist SyntaxC4/0d7185b30acf477c2033 addAzureWebsitePHPHandler.sh %}

**PowerShell Cmdlets**

<pre>
$phpMapping = (@{Extension="*.php";ScriptProcessor="d:\home\site\wwwroot\bin\php\php-cgi.exe"})
Set-AzureWebSite -HandlerMappings $phpMapping -Name &lt;website-name&gt;
</pre>
{% gist SyntaxC4/0d7185b30acf477c2033 New-AzureWebsitePHPHandler.ps1 %}

### Default PHP Extensions

Expand Down

0 comments on commit 02e7d68

Please sign in to comment.