Difference between revisions of "Opentaps Amazon EC2 Images"

From Opentaps Wiki
Jump to navigationJump to search
(Starting the AMI)
 
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__TOC__
 
__TOC__
  
Beginning with opentaps-1.4-preview2, you can use [http://aws.amazon.com/ec2/ Amazon EC2] images to install opentaps on an Amazon Elastic Computing Cloud virtual server.  You can find Amazon Machine Images (AMI) for opentaps which allow you to set up a virtual server with opentaps pre-installed with demo data.
+
opentaps [http://www.amazon.com/ec2 Amazon Elastic Computing Cloud (EC2)] images allow you to get up and running with opentaps in minutes using pre-stored Amazon Machine Images (AMI's).  You can use these AMI's for demo or production purposes, and you can pay for them by the hour.
  
You can watch our [http://www.youtube.com/watch?v=RkXpBTKVA4I YouTube video about opentaps on Amazon EC2] or follow the instructions below.
+
To learn more about how these AMI's work, see [http://www.opentaps.org/Cloud opentaps In The Cloud].  These instructions are included in the following [http://www.youtube.com/watch?v=CzvSAQXcwVY video for how to set up opentaps in the Amazon EC2 Cloud]:
  
==Recent Changes==
+
'''IMPORTANT''': Do not use the AMI's for sensitive data such as financial information or customer records unless you have secured the instance following the steps from the [http://shop.opentaps.org/index.php/opentaps-professional-configuration-service.html opentaps Professional Configuration Service] .
  
Beginning with opentaps 1.4.1,
+
==Starting the AMI==
* opentaps will be automatically moved from <tt>/opt/opentaps</tt> to <tt>/mnt/opentaps</tt> when the server is initially set up.  This takes approximately 5 minutes.  All references to <tt>/opt/opentaps</tt> below should be changed to <tt>/mnt/opentaps</tt>
 
  
==Finding opentaps Amazon EC2 Images==
+
To start using an opentaps Amazon EC2 image, you must first enable your Amazon account to use the [http://www.amazon.com/ec2 Amazon EC2] service.
  
To use an opentaps AMI, login to the Amazon AWS Management Console.  
+
Then, go to [http://www.opentaps.org/Cloud opentaps In The Cloud] and follow the links to subscribe to either the [https://aws-portal.amazon.com/gp/aws/user/subscription/index.html?ie=UTF8&offeringCode=8258DE39 opentaps Mini] or [https://aws-portal.amazon.com/gp/aws/user/subscription/index.html?ie=UTF8&offeringCode=B0CA38BF opentaps Full] '''You must subscribe to the opentaps AMI's by placing an order here first before you can launch them.'''
  
First, make sure that you are set to the "US East" region:
+
[[Image:Opentaps-amazon-ec2-subscription.png]]
  
[[Image:Amazon_ec2_region_us_east.png]]
+
Next, login to the [https://console.aws.amazon.com/ec2/home Amazon EC2 Management Console].  Make sure that your Region is one of the following where opentaps AMI's are available:
 +
* US East (N. Virginia)
 +
* EU West (Ireland)
 +
* Asia Pacific (Singapore)
  
Then, from the "Instances" screen, click on "Launch Instances", and then click on "Community AMIs"  and search for "opentaps".   You should see a list of opentaps machine images available, listing the version of opentaps and the preinstalled database, like this:
+
Click on "Launch Instance".
  
[[Image:Opentaps-amis.png]]
+
[[Image:Opentaps-amazon-ec2-launch-instance.png]]
  
 +
Now search for '''opentaps''' under "Community AMI's" to launch it:
 +
[[Image:Opentaps-amazon-ec2-find-ami.png]] 
  
Simply choose the image with the opentaps version and database that you would like to use, click on [Select] next to it, and then Amazon will take you to the next screen to finish setting up your server.
+
'''NOTE''': The opentaps 1.5 AMI images now have [[Tour_of_CRM2]] pre-loaded, and the names are opentaps-1-5-0-crm2-mysql and opentaps-1-5-0-crm2-mysql-mini.  See [[Set_up_CRM2]] on how to set up CRM2 after you start your AMI.
  
==Accessing your New opentaps Instance==
+
If you do not see the opentaps-1-5-0-crm2-mysql or opentaps-1-5-0-crm2-mysql-mini AMI, then you did not subscribe to the opentaps AMI's.  You must go back to [http://www.opentaps.org/Cloud opentaps In The Cloud] and subscribe to either the [https://aws-portal.amazon.com/gp/aws/user/subscription/index.html?ie=UTF8&offeringCode=8258DE39 opentaps Mini] or [https://aws-portal.amazon.com/gp/aws/user/subscription/index.html?ie=UTF8&offeringCode=B0CA38BF opentaps Full] AMI first and try again.
  
Once Amazon has set up your new opentaps instance, you can use the DNS to access it. For example, if your instance's public DNS is ec2-123-456-78-90.compute-1.amazonaws.com, that you can access opentaps from your browser at
+
You will go through a serious of screens to specify the configuration of your instance.  First, you need to choose the type of instance, including number of processors and memory:
  
http://ec2-123-456-78-90.compute-1.amazonaws.com:8080/opentaps
+
[[Image:Opentaps-amazon-ec2-instance-type.png]]
  
and you will be able to access your instance of opentaps, preloaded with the demo data.
+
Then, you can specify changes to the instance's options:
  
'''NOTE''': Starting with opentaps 1.4.1, you must wait about 5 minutes while the Amazon server moves opentaps from <tt>/opt/opentaps/</tt> to <tt>/mnt/opentaps/</tt>
+
[[Image:Opentaps-amazon-ec2-instance-options.png]]
 +
 
 +
After that, you need to specify a security key pair for accessing your instance:
 +
 
 +
[[Image:Opentaps-amazon-ec2-key-pairs.png]]
 +
 
 +
Next, you need to specify a security group.  You need a security group which allows access for SSH (port 22), HTTP (port 80), and HTTPS (port 443).  You can either pick an existing security group, if you've already created one, or set up a new one:
 +
 
 +
[[Image:Opentaps-amazon-ec2-security-group-1.png]]
 +
 
 +
If you are creating a new security group, then first give your security group a name:
 +
 
 +
[[Image:Opentaps-amazon-ec2-security-group-2.png]]
 +
 
 +
Then, add each port you need to use, like this:
 +
 
 +
[[Image:Opentaps-amazon-ec2-security-group-3.png]]
 +
 
 +
When you've added all the ports you need, click on <tt>Continue</tt>
 +
[[Image:Opentaps-amazon-ec2-security-group-4.png]]
 +
 
 +
Now you are ready to launch your instance.  Look through everything one more time and click on <tt>Launch</tt> if you're sure:
 +
[[Image:Opentaps-amazon-ec2-security-group-5.png]]
 +
 
 +
Once you've clicked <tt>Launch</tt>, Amazon should tell you that your instance is launching:
 +
[[Image:Opentaps-amazon-ec2-launched.png]]
 +
 
 +
'''IMPORTANT''':  If you did not subscribe to the opentaps AMI's first, then your AMI's could not be launched successfully.  You will receive an error message like '''Subscription to ProductCode XXXXXXXX required.''': 
 +
 
 +
[[Image:EC2_Subscription_Required.png]]
 +
 
 +
You must go back to [http://www.opentaps.org/Cloud opentaps In The Cloud] to purchase a subscription to an opentaps AMI first, and then try again.
 +
 
 +
==Using the AMI==
 +
 
 +
Once you have successfully launched your AMI, your  [https://console.aws.amazon.com/ec2/home Amazon EC2 Management Console] will show that is pending:
 +
 
 +
[[Image:Opentaps-amazon-ec2-pending.png]]
 +
 
 +
Wait until it shows a green button next to your instance:
 +
 
 +
[[Image:Opentaps-amazon-ec2-running.png]]
 +
 
 +
This means that the instance is up and running.  The instance should also show a public DNS address which begins with <tt>ec2-</tt>, like <tt>ec2-123-456-78-90.compute-1.amazonaws.com</tt>  (In this screenshot, it is <tt>ec2-184-73-130-105.compute-1.amazonaws.com</tt>)  You will be using this address to access the instance.
 +
 
 +
When the instance first starts up, opentaps will be automatically moving itself from <tt>/opt/opentaps</tt> to <tt>/mnt/opentaps</tt>.  This takes approximately 5 minutes. 
 +
 
 +
When it is done, you can access opentaps from your browser with its public DNS address, like this:
 +
 
 +
http://ec2-123-456-78-90.compute-1.amazonaws.com/opentaps
 +
 
 +
The initial username and password are '''admin'''/'''opentaps'''
 +
 
 +
opentaps 1.4.2 and opentaps 1.5M1 are both preloaded with [[How to Setup opentaps from Default Template|Base Template]] data which you can customize to set up your company.
 +
 
 +
== Instance vs. AMI ID ==
 +
 
 +
It is important to know how to identify your instance.  Amazon EC2 gives you two ID's, an instance ID and an AMI ID:
 +
 
 +
[[Image:Opentaps-amazon-ec2-instance-ami-id.png]]
 +
 
 +
The instance ID, which is <tt>i-6236840f</tt> here, is a unique ID for your particular server.  The AMI ID, which is <tt>ami-26ae594f</tt>, is the machine image, or AMI, you used to start your server.  It corresponds to a particular snapshot of opentaps, Linux, and MySQL.  This AMI could be used by many people's instances.
  
 
==Managing your opentaps Instance==
 
==Managing your opentaps Instance==
  
To manage your opentaps instance, use your Amazon .pem key and login as root:
+
To manage your opentaps instance, use your Amazon .pem key and login to login.  If you are using opentaps 1.4.2 or later AMI's, the Amazon base linux does not allow root login, so you must login as the <tt>ec2-user</tt> and then sudo as <tt>root</tt>:
 +
 
 +
$ ssh ec2/mysecurekey.pem ec2-user@ec2-123-456-78-90.compute-1.amazonaws.com
 +
$ sudo su root
 +
 
 +
If you are using opentaps 1.5M1, you can login directly as <tt>root</tt>:
  
 
  $ ssh ec2/mysecurekey.pem root@ec2-123-456-78-90.compute-1.amazonaws.com
 
  $ ssh ec2/mysecurekey.pem root@ec2-123-456-78-90.compute-1.amazonaws.com
  
By convention, opentaps will be installed in the /opt/opentaps directory, so you can go to your version as the root user:
+
By convention, opentaps will be installed in the `/mnt/opentaps` directory, so you can go to your version as the root user:
  
  $ cd /opt/opentaps/opentaps-1.4-preview-2
+
  $ cd /mnt/opentaps/opentaps
  
 
and modify the configuration files.
 
and modify the configuration files.
 
For example, if you want opentaps to run on port 80 and 443, edit the files <tt>framework/base/config/ofbiz-containers.xml</tt> and <tt>framework/webapp/config/url.properties</tt> and change the ports 8080 and 8443 to 80 and 443.
 
  
 
To start, stop, or restart opentaps, you can use the /etc/init.d/opentaps script:
 
To start, stop, or restart opentaps, you can use the /etc/init.d/opentaps script:
Line 54: Line 122:
 
  $ /etc/init.d/opentaps start
 
  $ /etc/init.d/opentaps start
  
Now you should be able to access opentaps at http://ec2-123-456-78-90.compute-1.amazonaws.com/opentaps
+
==Switching from Production to Demo==
 +
 
 +
Starting with opentaps 1.4.2 (but not 1.5M1), the same instance can be used for both demo or production purposes.  By default, opentaps 1.4.2 AMI is configured to use the [[How to Setup opentaps from Default Template|Base Template]] database, but you can switch to the demo database with
 +
 +
$ /etc/init.d/opentaps switch-demo
 +
 
 +
To switch back to the [[How to Setup opentaps from Default Template|Base Template]] database, which is recommended for configuring your production instance:
 +
 
 +
$ /etc/init.d/opentaps switch-prod
 +
 
 +
==Setting up opentaps Update Service==
 +
 
 +
''These instructions apply to opentaps 1.4.2 and later AMI's''
 +
 
 +
Your opentaps AMI comes with a free subscription to the [http://www.opentaps.org/opentaps-update-service opentaps Update Service].  To register yourself, [http://www.opentaps.org/Contact contact opentaps] with your Amazon instance ID (see below):
 +
 
 +
Once we have verified your instance, you will receive a username and password for the service. Edit the file `/etc/init.d/opentaps` and put it in the fields for
 +
 
 +
$ SVN_USERNAME=
 +
$ SVN_PASSWORD=
 +
 
 +
Then, you can update opentaps with
 +
 
 +
$ /etc/init.d/opentaps update
  
==Deploying opentaps For Production in Amazon EC2==
+
==Completing your Setup==
  
For production deployments, you can use the [https://aws-portal.amazon.com/gp/aws/user/subscription/index.html?ie=UTF8&offeringCode=B0CA38BF Pre-configured opentaps AMI] with opentaps and MySQL configured for production environmentsSee [http://www.opentaps.org/opentaps-In-Cloud opentaps In The Cloud] for more details.
+
'''IMPORTANT''' Before using your AMI for sensitive data, you need to secure it with an SSL certificateThe [http://shop.opentaps.org/index.php/opentaps-professional-configuration-service.html opentaps Professional Configuration Service] can help you secure your production instance and configure email, DNS, and performance monitoring.

Latest revision as of 20:05, 1 November 2013

opentaps Amazon Elastic Computing Cloud (EC2) images allow you to get up and running with opentaps in minutes using pre-stored Amazon Machine Images (AMI's). You can use these AMI's for demo or production purposes, and you can pay for them by the hour.

To learn more about how these AMI's work, see opentaps In The Cloud. These instructions are included in the following video for how to set up opentaps in the Amazon EC2 Cloud:

IMPORTANT: Do not use the AMI's for sensitive data such as financial information or customer records unless you have secured the instance following the steps from the opentaps Professional Configuration Service .

Starting the AMI

To start using an opentaps Amazon EC2 image, you must first enable your Amazon account to use the Amazon EC2 service.

Then, go to opentaps In The Cloud and follow the links to subscribe to either the opentaps Mini or opentaps Full You must subscribe to the opentaps AMI's by placing an order here first before you can launch them.

Opentaps-amazon-ec2-subscription.png

Next, login to the Amazon EC2 Management Console. Make sure that your Region is one of the following where opentaps AMI's are available:

  • US East (N. Virginia)
  • EU West (Ireland)
  • Asia Pacific (Singapore)

Click on "Launch Instance".

Opentaps-amazon-ec2-launch-instance.png

Now search for opentaps under "Community AMI's" to launch it: Opentaps-amazon-ec2-find-ami.png

NOTE: The opentaps 1.5 AMI images now have Tour_of_CRM2 pre-loaded, and the names are opentaps-1-5-0-crm2-mysql and opentaps-1-5-0-crm2-mysql-mini. See Set_up_CRM2 on how to set up CRM2 after you start your AMI.

If you do not see the opentaps-1-5-0-crm2-mysql or opentaps-1-5-0-crm2-mysql-mini AMI, then you did not subscribe to the opentaps AMI's. You must go back to opentaps In The Cloud and subscribe to either the opentaps Mini or opentaps Full AMI first and try again.

You will go through a serious of screens to specify the configuration of your instance. First, you need to choose the type of instance, including number of processors and memory:

Opentaps-amazon-ec2-instance-type.png

Then, you can specify changes to the instance's options:

Opentaps-amazon-ec2-instance-options.png

After that, you need to specify a security key pair for accessing your instance:

Opentaps-amazon-ec2-key-pairs.png

Next, you need to specify a security group. You need a security group which allows access for SSH (port 22), HTTP (port 80), and HTTPS (port 443). You can either pick an existing security group, if you've already created one, or set up a new one:

Opentaps-amazon-ec2-security-group-1.png

If you are creating a new security group, then first give your security group a name:

Opentaps-amazon-ec2-security-group-2.png

Then, add each port you need to use, like this:

Opentaps-amazon-ec2-security-group-3.png

When you've added all the ports you need, click on Continue Opentaps-amazon-ec2-security-group-4.png

Now you are ready to launch your instance. Look through everything one more time and click on Launch if you're sure: Opentaps-amazon-ec2-security-group-5.png

Once you've clicked Launch, Amazon should tell you that your instance is launching: Opentaps-amazon-ec2-launched.png

IMPORTANT: If you did not subscribe to the opentaps AMI's first, then your AMI's could not be launched successfully. You will receive an error message like Subscription to ProductCode XXXXXXXX required.:

EC2 Subscription Required.png

You must go back to opentaps In The Cloud to purchase a subscription to an opentaps AMI first, and then try again.

Using the AMI

Once you have successfully launched your AMI, your Amazon EC2 Management Console will show that is pending:

Opentaps-amazon-ec2-pending.png

Wait until it shows a green button next to your instance:

Opentaps-amazon-ec2-running.png

This means that the instance is up and running. The instance should also show a public DNS address which begins with ec2-, like ec2-123-456-78-90.compute-1.amazonaws.com (In this screenshot, it is ec2-184-73-130-105.compute-1.amazonaws.com) You will be using this address to access the instance.

When the instance first starts up, opentaps will be automatically moving itself from /opt/opentaps to /mnt/opentaps. This takes approximately 5 minutes.

When it is done, you can access opentaps from your browser with its public DNS address, like this:

http://ec2-123-456-78-90.compute-1.amazonaws.com/opentaps

The initial username and password are admin/opentaps

opentaps 1.4.2 and opentaps 1.5M1 are both preloaded with Base Template data which you can customize to set up your company.

Instance vs. AMI ID

It is important to know how to identify your instance. Amazon EC2 gives you two ID's, an instance ID and an AMI ID:

Opentaps-amazon-ec2-instance-ami-id.png

The instance ID, which is i-6236840f here, is a unique ID for your particular server. The AMI ID, which is ami-26ae594f, is the machine image, or AMI, you used to start your server. It corresponds to a particular snapshot of opentaps, Linux, and MySQL. This AMI could be used by many people's instances.

Managing your opentaps Instance

To manage your opentaps instance, use your Amazon .pem key and login to login. If you are using opentaps 1.4.2 or later AMI's, the Amazon base linux does not allow root login, so you must login as the ec2-user and then sudo as root:

$ ssh ec2/mysecurekey.pem ec2-user@ec2-123-456-78-90.compute-1.amazonaws.com
$ sudo su root

If you are using opentaps 1.5M1, you can login directly as root:

$ ssh ec2/mysecurekey.pem root@ec2-123-456-78-90.compute-1.amazonaws.com

By convention, opentaps will be installed in the `/mnt/opentaps` directory, so you can go to your version as the root user:

$ cd /mnt/opentaps/opentaps

and modify the configuration files.

To start, stop, or restart opentaps, you can use the /etc/init.d/opentaps script:

$ /etc/init.d/opentaps stop
$ /etc/init.d/opentaps start

Switching from Production to Demo

Starting with opentaps 1.4.2 (but not 1.5M1), the same instance can be used for both demo or production purposes. By default, opentaps 1.4.2 AMI is configured to use the Base Template database, but you can switch to the demo database with

$ /etc/init.d/opentaps switch-demo

To switch back to the Base Template database, which is recommended for configuring your production instance:

$ /etc/init.d/opentaps switch-prod

Setting up opentaps Update Service

These instructions apply to opentaps 1.4.2 and later AMI's

Your opentaps AMI comes with a free subscription to the opentaps Update Service. To register yourself, contact opentaps with your Amazon instance ID (see below):

Once we have verified your instance, you will receive a username and password for the service. Edit the file `/etc/init.d/opentaps` and put it in the fields for

$ SVN_USERNAME=
$ SVN_PASSWORD=

Then, you can update opentaps with

$ /etc/init.d/opentaps update

Completing your Setup

IMPORTANT Before using your AMI for sensitive data, you need to secure it with an SSL certificate. The opentaps Professional Configuration Service can help you secure your production instance and configure email, DNS, and performance monitoring.