Virtualmin GPL AMI

Posted 2009-05-18 09:39 by andreychek

AMI Summary

Region Operating System AMI
US East CentOS ami-7c1df915
US East Debian ami-dd13f7b4
US West CentOS ami-d389d896
Europe CentOS ami-dc1a32a8
Southeast Asia CentOS ami-ffe699ad

Virtualmin GPL AMI on EC2

Amazon's Elastic Computing Cloud (EC2) is a commercial service that provides virtual Linux systems running on Amazon's network, for which customers are charged by the hour. One of its useful features is the ability to launch a virtual system using a machine image (AMI) defined by another user, which could contain anything from a basic install of Linux up to a full application stack.

If you have an EC2 account, you can easily launch an image ( ami-7c1df915 ) containing Webmin, Virtualmin, Usermin and all the dependent programs like Apache, MySQL and Postfix, all running on CentOS. This lets you bring up a web hosting server in minutes, and either try out Virtualmin or start using it for real web hosting. The steps to do this are :

Launching From the AWS Web Interface

  1. Sign up for an Amazon EC2 account on their registration page.
  2. Go to the AWS Management Console at https://console.aws.amazon.com/ec2/home , and login with your Amazon account.
  3. Click the Launch Instance button, and select the Community AMIs tab.
  4. Enter our account 093590521311 into the search box, then click the Select button next to the AMI ami-7c1df915.
  5. On the next tab, change the availability zone if you need a specific zone, then click Continue.
  6. On the next tab, change the availability zone if you need a specific zone, then click Continue.
  7. Click Continue again to accept the default kernel and ramdisk.
  8. Select one of your EC2 SSH keys that will be used to login to this instance, then click Continue again.
  9. Choose the default security group, then hit Continue.
  10. Finally, review your settings and click the Launch button.

Launching From the Command Line

  1. Sign up for an Amazon EC2 account on their registration page.
  2. Follow Amazon's getting started instructions to install the needed tools, in particular the Prerequisites, Setting up an Account and Setting up the Tools pages.
  3. Once you have the ec2 commands working, use the following command to list available Virtualmin AMIs :
    ec2-describe-images -o 093590521311

    You should see at least one in the available state.

  4. Setup an SSH key with the commands :
    ec2-add-keypair vgpl-keypair >~/.ssh/id_rsa-vgpl-keypair
    chmod 700 ~/.ssh/id_rsa-vgpl-keypair
  5. Start a new instance with the AMI for Virtualmin GPL with the command :
    ec2-run-instances ami-7c1df915 -k vgpl-keypair

    This will output the new instance ID, with is like i-10a64379

  6. Check its status with the command :
    ec2-describe-instances

    You will need to wait until it is in the running state. You will then be able to see the public hostname, which looks like ec2-72-44-33-55.z-2.compute-1.amazonaws.com .

  7. Open the needed firewall ports with the commands :
    ec2-authorize default -p 22
    ec2-authorize default -p 25
    ec2-authorize default -p 10000
    ec2-authorize default -p 10001
    ec2-authorize default -p 10002
    ec2-authorize default -p 10003
    ec2-authorize default -p 10004
    ec2-authorize default -p 10005
    ec2-authorize default -p 10006
    ec2-authorize default -p 10007
    ec2-authorize default -p 10008
    ec2-authorize default -p 10009
    ec2-authorize default -p 20000
    ec2-authorize default -p 80
    ec2-authorize default -p 443
    ec2-authorize default -p 21
    ec2-authorize default -p 20
    ec2-authorize default -p 110
    ec2-authorize default -p 143
    ec2-authorize default -p 53
    ec2-authorize default -p 53 -P udp
  8. Try a test SSH login with the command :
    ssh -i ~/.ssh/id_rsa-vgpl-keypair root@ec2-WHATEVER.compute-1.amazonaws.com
  9. Connect to Webmin at the URL : http://ec2-WHATEVER.compute-1.amazonaws.com:10000/ . The initial login is root and password is changeme .
  10. Click on the Webmin link in the top-left, open the Webmin category, click on Change Language and Theme, and enter a new password!
  11. To ensure that all packages are up to date, click on System Information at the bottom of the left frame. If you are prompted to install any packages on the information page that appears on the right, do so.
  12. Click back on the Virtualmin link on the top-left, and click on Create Virtual Server to create your first domain.

Virtualmin EC2 Image in Other Regions

EC2 now has a separate European region, which has it's own set of machines and AMIs. To launch the Virtualmin image in Europe, follow the instructions above but use the AMI ami-dc1a32a8 instead.

Also, you will need to set the EC2_URL environment variable before using the command-line tools, with a statement like :

export EC2_URL=https://eu-west-1.ec2.amazonaws.com

Similarly, EC2 has a California region which again has a separate set of AMIs available. To launch the Virtualmin image in California, follow the instructions above but use the AMI ami-d389d896 and the EC2_URL https://us-west-1.ec2.amazonaws.com

To launch the Virtualmin image in Southeast Asia, follow the same instructions but use the AMI ami-ffe699ad and the EC2_URL https://ap-southeast-1.ec2.amazonaws.com

Virtualmin GPL Debian Etch Image

An EC2 image now exists for Virtualmin GPL on Debian 4.0 (Etch). The instructions for starting this are exactly the same as above, but the image ID is ami-dd13f7b4 . So the command to start it would be :

ec2-run-instances ami-dd13f7b4 -k vgpl-keypair