This project is read-only.

Contents

Download in PDF
  1. Abstract
  2. Introduction
  3. Background
  4. Deploying and Running MoodleAzure
  5. Packaging, Configuring and Deploying the Solution
  6. Implementation Details: What Changed
  7. Horizontally Scaling the Application
  8. Conclusion

Packaging, Configuring and Deploying the Solution

Now that we have setup an appropriate development environment, we need to get the source code, add PHP binaries to our solution, configure our deployment, and run our application on the cloud.

1.       Get the latest zip release of MoodleAzure source code from Codeplex (http://moodleazure.codeplex.com). You should be able to find it in under the “Downloads” section.

2.       Extract the files to the folder “C:\projects\moodleazure\”, which we created in step 5 of the previous section.

3.       Go to your PHP installation folder. In x86 architectures, this should be “C:\Program Files\PHP”. In x64 architectures it should be “C:\Program Files (x86)\PHP”. Copy all of the files located inside the PHP installation folder EXCEPT FOR “php.ini” -- MoodleAzure source distributions comes preconfigured with a php.ini file --. Paste the copied files on to “C:\projects\moodleazure\MoodleWebRole\php”

4.       Go to: Start Menu > All Programs > Microsoft Visual Studio 2010; right click on the Microsoft Visual Studio shortcut and select “Run as Administrator”. Open up the Unosquare.MoodleAzure.sln file within Visual Studio.

5.       Expand the MoodleWebRole project and configure MoodleAzure by providing the correct values for the settings listed in the table below.

File (line)

Setting

Value

config.php (7)

$CFG->dbhost

Replace the accountname with your Sql Azure account name

config.php (8)

$CFG->dbname

Make sure there is a “moodle19” database created in your Sql Azure account

config.php (9)

$CFG->dbuser

Replace username by the actual Sql Azure username. Replace accountname with your Sql Azure account name.

config.php (10)

$CFG->dbpass

Your Sql Azure account password

config.azure.php (7)

$CGF->wwwroot

Replace sitename with the web role account name.

config.azure.php (25)

$azureAccountName

This is your storage services account name.

config.azure.php (26)

$azureAccountKey

This is your storage services account key. It is a base 64-encoided key.

 

6.       Right click on the Unosquare.MoodleAzure Project and select “Publish…”. You can deploy the service directly through Visual Studio by selecting the “Deploy your Cloud Service to Windows Azure” option and setting up your deployment credentials. It might take around 15 minutes to upload the service package, and create the Azure Virtual Machine.

7.       Open up a browser and go to http://(sitename).cloudapp.net where sitename is the account name of your web role. The site will take some time to generate a response. If the response takes longer than 35 seconds, it will show a 500 error. This is because there is currently no way of telling FastCGI on Azure to allow for longer execution times. If you get a 500 error, refresh the page. If you get a message that an upgrade is already running, click the (!!!) link. If you get a page indicating that tables were created successfully and there is no continue button, refresh the page. Repeat this procedure until  the database setup is complete.

Last edited Oct 28, 2010 at 5:42 PM by unosquare, version 2

Comments

sandipshinde Jul 2, 2011 at 5:36 PM 
I'm getting error like The service is unavailable.