Friday, December 26, 2008

Preparing Windows EC2 instance for AMI creation

Review your EC2 settings. Start>All Programs>EC2Service Settings

Clean your disks. Start>All Programs>Accessories>System Tools>Disk clean

Clear out the bytes from deleted space. sdelete –c C:  and sdelete –c D:  (You can get sdelete from the sysinternals site).

Log off the remote desktop.

Using ElasticFox, right click the running instance and  select “Bundle into an AMI”. The S3 bucket name should be globally unique. Note the bucket name and image name carefully (you’ll need it for the registration step). Keep checking the Bundle Tasks tab of ElasticFox to see when it finishes the bundling.

After that, use the “AMI and Instances” tab to register your new AMI. The manifest file name is of the pattern “bundle/imagename.manifest”.

Using the Windows Branded Live site.

* Update - After releasing Outlook.com in 2012, Microsoft has stopped its Live service and custom domains. If you had emails setup with a custom domain, they will continue working but you cannot add new accounts or manage passwords with an admin account.

Microsoft Live has a service (formerly called Custom Domains) that allows you to create a Window’s Live hosted site. Its called the Partner Live program. (https://partners.microsoft.com/partnerprogram/welcome.aspx)
However trying to locate the free service proved difficult. So I went back to the article in CODE magazine (http://www.code-magazine.com/Article.aspx?quickid=0804112) So in short logon to admincenter.live.com to get started!
Now lets try Google’s Apps. Hmm… no way from the search page to even find it. Found the address on one BLOG page. http://www.google.com/a 
Both require that you must modify your DNS records.

Friday, December 12, 2008

Installing Moodle on Amazon EC2

To reduce the disk cost, I decided to create a separate hard disk volume that you can attach to any Windows AMI instance. Any changes that you make to the Moodle are saved to this separate volume. So when you shutdown your instance, the changes are persistent. The only disadvantage is an extra step of attaching the hard disk after the machine is running. The advantage is that you spend less. 1GB of EBS = 0.10 cents per month, vs 3GB AMI = 3x0.15 cents =0.45 cents per month. It is also easier to create snapshots of the disk in this manner. Just right click the volume and create a snapshot. The snapshot is stored on S3.

I’ve created one snapshot of the initial disk – which can be used for new Moodle installs.

Starting up Moodle.

  1. Start any Windows image (I’ve tried it with ami-ec698d85 Server2003r2-i386-WinAuth-v1.02 and ami-e5698d8c Server2003r2-i386-Win-v1.02) Keep in mind that the Auth server is double the money compared to the vanilla windows.
    IMPORTANT: After you right click to launch an instance; In the dialog box, set the Availability zone =”us-east-1c” for the machine. Your volume is located in that zone. Data transfer is free if machine and volume are in the same zone.
  2. Right click the instance and “Show console output”. Wait till you see a message “Message: Windows is Ready to use”. This usually takes about 10 minutes from when you start.
  3. Once the instance is running, in ElasticFox go to tab “Volumes and Snapshots”. Right click and attach volume (vol-4b9d7922) as “xvdg”.
    The disk is automatically mapped to “E” if you do this after the ready message in the “Show console output”. (The volume initially contains an unzipped version of the Windows package installer from moodle.org.)
    1. If you do it before “Windows is ready to use”; you must manually change the drive letters.
      (Start>Administrative tools>Computer Management)
    2. Click Storage>Disk Management
  4. Right click the instance and “Get Administrator password”.
  5. [optional] If you are going to use an Elastic IP, do that now.
  6. [optional] Modify DNS on your domain nameserver to point to this new instance.
  7. Right click the instance and “Connect to Public DNS name”.
  8. Tip (optional) – when you use your browser, you are in Internet Explorer Enhanced Security mode. To turn off Internet Explorer Enhanced Security:
  9. http://www.windowsreference.com/windows-2003/how-to-disable-internet-explorer-enhanced-security-configuration-ie-esc-in-windows-server-20082003/
  10. Open “E” drive
  11. Edit the files E:\server\moodle\config.php (this is not needed when you haven’t configured Moodle for the first time. The file is created during Moodle configuration.)
  12. Click Start>Run and enter “net stop w3svc”. This stops the IIS server.
  13. Click “Start moodle.exe”
    It should start up. If there is a question about reconfiguration, press 1 and enter to proceed.
    The program will continue running in a DOS box with the message “Run STOP Moodle…..” or a blank DOS box.
  14. Click “My public IP” to get the IP address of your instance. (If you haven’t turned off Internet Enhanced Security, you will see a number of warning dialog boxes which you can ignore.)
  15. From your own PC, use a browser to open that instance. You should see the Moodle page.
    Once you are done, you can close the Remote Desktop window (do not logout, just close the window).

Stopping.

Right click the instance and “Connect to Public DNS name”.
Click “Stop Moodle.exe”.

Shutdown the server.

After the server is terminated, delete any Elastic IP addresses that you had attached.

Appendix: Editing Moodle’s config for EC2.

Once you have finished installation, the setup of moodle hard binds the name of the server in the setup files. You must change this if you want to access Moodle from outside the AMI.

Pre-startup - There are two files that should be modified.

1. D:\server\moodle\config.php
Change the line
$CFG->wwwroot = 'http://nooradel';
to
$CFG->wwwroot = 'http://<new public DNS name or elastic IP>';

2. [Optional] D:\server\apache\conf\httpd.conf
Change the line
Servername = localhost:80
to
Servername = <new public DNS name or elastic IP>:80

Helpful links

Setup instructions for Moodle on Windows

http://docs.moodle.org/en/Complete_install_packages_for_Windows

Command line for Amazon EC2.

http://docs.amazonwebservices.com/AWSEC2/2008-12-01/DeveloperGuide/

If you want to find out your own IP address inside a AMI (http://169.254.169.254/latest/meta-data/public_ipv4)

For more details see http://docs.amazonwebservices.com/AWSEC2/2008-05-05/DeveloperGuide/index.html?AESDG-chapter-instancedata.html

Setup the environment to run EC2 command line control tools. (See section on Configuring your workstation).

http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1827&categoryID=100

Key solutions

The key “amazon_ec2.pem” must be used instead of “amazon_ec2.ppk” to retrieve the Windows Administrator password.

Setup in Tools:

  • SSH Key template: ${home}\ec2-keys\${keyname}.ppk
  • EC2 Private key template: ${home}\ec2-keys\${keyname}.pem

You can re-download the public key by going to the web page. However the private key is not stored on the server. Keep it carefully.

  • Amazon_ec2.ppk (putty version of key pair amazon_ec2. )
  • Amazon_ec2.pem (EC2 version of key pair amazon_ec2.)
  • PK-0…..pem (Amazon account private key)
  • CERT-0…pem (Amazon account public key)

Thursday, December 04, 2008

Microsoft Windows Azure and Geneva and Bulldog

Over the last couple of weeks, I’ve seen a lot of information about various products from Microsoft.

Azure

A distributed operating system for the “cloud”. The idea here is that you write to the Azure API on your desktop. Run / debug it on the desktop. When you deploy it to Azure, Microsoft will run this on “server” fabric. You don’t have to worry about individual servers, scalability etc. Since your code could end up running on different servers due to load balancing, all state information must be stored centrally. Azure provides a distributed storage and a distributed SQL Server data storage to address these requirements. Azure is in CTP. You can download the SDK and play around on your own PC. If you want to deploy to Azure, you’ll need a invitation token (these were given out in PDC 2008). For the development machine, you need Windows 2008 or Vista, Visual Studio 2008.

MDM BullDog

Microsoft acquired Stratature’s MDM product (eDM). This is a robust MDM tool that is in its 4th generation. Profisee is the firm spun off by ex-Stratature employees. Ian from Profisee gave an excellent introduction to this tool. What I liked was its out of box Web UI, Workflow, Business Rules and a solid BI focus.

Geneva

This gets exciting. In the Identity space, there is a shift from applications managing your identity (uid/pwd) to claim based authentication/authorization. To use an application (RP-relying party), you need to provide a token with the appropriate claims from a trusted STS. The IP (Identity provider) STS (Secure Token Service) issues you a token with the claims, after you logon to the STS. It signs the token with a private key. The RP can decode the token and extract the claims to decide whether the user is allowed to use the application. So why is it exciting?

The IP can be Yahoo OpenID, Google, Microsoft Live or even a self issued IP. Your app can choose to trust all these STS’s; or a better way is to trust a single STS and ask the user to get a token from this STS using the token from the first STS. This provides a transparent way to federate identity. Everything is service based that makes it easy for active / passive logon. Geneva provides 3 components – Geneva server which is a Windows based STS, Geneva Cardspace which is an identity selector and Geneva framework which is an API for applications that need to use Geneva. The nice thing is that these are not bound and are based on open standards (WS-Trust, SAML, WS-Security). While searching for this, found that WCF provides a wsFederation binding that can handle claim based authentication in WCF.

Cardspace Identity selector

image

Enterprise case

image

Internet case

image

Using external STS

image

Multiple STS

image

image