Introduction
Wordpress Azure Mµ is some custom changes to the basic
wordpress install, that better take advantage of what Azure offers and to allow
Wordpress Multisite on Azure.
http://helixten.azurewebsites.net/
Background
So
out of the box azure supports wordpress. That is great but it is missing some great features to full use the power of Azure. Also there are some "bugs/missing features" That need to be addressed. Like it does not work
with Wordpress Multisite out of the box. Also it is not setup to use the Azure blob storage or Sql Azure.
How Azure might benefit the project?
The benefits of using azure is the scalability and the flexibility.
Use azure I don’t have to worry about one site getting slash doted and bring
down the whole network.
Let Begin!
To start of create a site and using the Azure gallery create
a wordpress site. Just follow the steps boom done! Well not quite… After the install is done, pick what
feature you want to add below!
Custom Changes
- Wordpress Multisite with multi-domain support
To add multisite add the /* Multisite */ code to your wp-config.php Make sure SUBDOMAIN_INSTALL is false! Next install the WordPress MU Domain mapping plugin this will make the domain name to the right site. Follow the plug steps to move the sunrise.php to the right place afterward add /* for domain mapping */ code to the wp-config.php. Then In the Azure control panel make sure you add all the domain names. Boom Done! You can add sites to your wordpress - Azure blob for storage
I really recommend this! To use blog storage to host your
image add Windows Azure Storage for WordPress plugin. It is really easy to
setup. If you are using multisite do not “Network Activate” That won’t work
just enable it on each site. You can
also use the cdn using this plugin! - Stop All The Error Print Outs
Php on Azure print all warning and errors. While that is great for debugging it is not good for a site in production. Some pluld will display pgp Notice print outs to turn it off add the line below to the php page;
error_reporting(E_ALL ^ E_NOTICE); - Sql Azure for the database (instead of the default of ClearDB)
Now to change ClearDB to Sql Azure… O wait that is the
next challenge!
- Cache with cdn
Coming Soon...
Using the code
Web.config To Use Multisite
="1.0" ="UTF-8"
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WordPress Rule 1" stopProcessing="true">
<match url="^index\.php$" ignoreCase="false" />
<action type="None" />
</rule>
<rule name="WordPress Rule 2" stopProcessing="true">
<match url="^([_0-9a-zA-Z-]+/)?files/(.+)" ignoreCase="false" />
<action type="Rewrite" url="wp-includes/ms-files.php?file={R:2}" appendQueryString="false" />
</rule>
<rule name="WordPress Rule 3" stopProcessing="true">
<match url="^([_0-9a-zA-Z-]+/)?wp-admin$" ignoreCase="false" />
<action type="Redirect" url="{R:1}wp-admin/" redirectType="Permanent" />
</rule>
<rule name="WordPress Rule 4" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions logicalGrouping="MatchAny">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />
</conditions>
<action type="None" />
</rule>
<rule name="WordPress Rule 5" stopProcessing="true">
<match url="(^[_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)" ignoreCase="false" />
<action type="Rewrite" url="{R:2}" />
</rule>
<rule name="WordPress Rule 6" stopProcessing="true">
<match url="^([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
<action type="Rewrite" url="{R:2}" />
</rule>
<rule name="WordPress Rule 7" stopProcessing="true">
<match url="." ignoreCase="false" />
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="104857600" /> -->
</requestFiltering>
</security>
</system.webServer>
</configuration>
wp-config.php Add this for multisite
/* Multisite */
define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
$base = '/';
define('DOMAIN_CURRENT_SITE', 'YOUR SITE');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
Add After WordPress MU Domain Mapping is installed
/* For domain mapping */
define( 'SUNRISE', 'on' );
Add TO Plugins That print errors.
error_reporting(E_ALL ^ E_NOTICE);