Omnis Technical Note TNJS0007Sept 2016
Setting up a Server on Amazon Web Services (AWS)
for Omnis Studio 6.0 or above
By Richard Miller, Omnis Engineering
AWS is a comprehensive system which relieves you of the procurement, setup and day-to-day management of computer servers along with the associated upfront costs. Instead you pay on an hourly basis according to the size and type of system you have defined. This tech note concentrates on using an AWS EC2 Windows environment. EC2 is the cloud web service that provides resizable computing capacity.
Disclaimer: The information in this tech note in no way constitutes a recommendation of Amazon Web Services (AWS) and we advise you to explore all other options, commercial or otherwise, regarding the deployment of your Omnis applications on a cloud-based environment.
Creating Your Cloud Server
Sign in to the AWS management console. The initial screen gives a seemingly bewildering array of options, but with links to some help documents on the right hand side.
However, we just need the first option, EC2, which will allow us to create and manage our cloud servers.
From the EC2 dashboard, select the Launch Instance button.
You are now presented with a list of Amazon Machine Instances (AMI’s). These are templates of the type of server you require allowing you to choose between differing flavours of Linux or Windows and whether you wish for a SQL database to be included or not. Some of these AMI’s are marked Free Tier Eligible. If you are a new AWS customer, then you may be able to receive some AWS services free for a year.
- Choose your AMI. On the Quick Start tab, (at the time this document was written), there are 25 AMI's available. We are going to select Microsoft Windows Server 2012 Base. This will provide a standard version of Windows 2012 Server within a 64 bit architecture with no database installed.
- Choose an Instance Type. Having selected the base AMI, you now have to select the instance type you require. Each type belongs to a group that gives a differing level of resources from t2.nano up to i2.8xlarge. AWS term these groups as "Family" and give an indication of their usage such as general purpose, compute optimized, storage optimized etc.
We are just going to go with t2.micro. This has 1 virtual CPU and 1GB of memory but is ideal for testing the concept. It also has the advantage of being eligible for the free tier if you are new to AWS, so is ideal for testing.
Now click on Next: Configure Instance Details
- Configure Instance Details. This page gives you a number of options that allow you to fine tune your instance, including specifying the number of instances you require, identifying the networks you wish to be able to use with your instance, and indicating what happens to your instance when it shuts down. We will leave the default settings and go to the Storage page.
- Add Storage. The default for disk size for this instance type is 30GB. You can increase the disk size here, if required, but for now we will leave the default setting and go the next page.
- Tag Instance. Tags are used as metadata that allow you to manage your instances. They are key value pairs such as "Server=OmnisAWSTest". There is no need to set any, so we will go to the next step.
- Configure Security Group. A security group acts as a firewall and controls traffic to your instance. By default, this screen defaults to allowing any IP address to connect to the instance via Remote Desktop (RDP). You may wish to set this to your current IP address by changing the value in the Source droplist from Anywhere to MyIP or Custom. The MyIP setting automatically determines your IP address. In this case, we will use MyIP. NB: You can alter the value once the instance is launched.
- You now need to confirm your settings and launch the instance.
- Select key pair or create a new key pair. This dialog allows you to use an existing key pair or create a new one. The private key file is used to obtain the password for your instance.
- Select Launch Instances and your instance will start to launch.
Select the link to the instance (in this case: i-1c325085) and this will take you to the "Instances" section of the AWS management console and your instance is displayed.
At this point, you will have to wait a few minutes for status checks to complete.
Click on Actions to open a dropdown menu and then click Get Windows Password. A dialog will open allowing you to select the private key file you downloaded earlier.
The password is then returned.
From your client machine, open Remote Desktop and enter the IP address of your new server and click Connect.
After a short while, remote desktop will connect and if you look at the right of the screen, you will see top-level status data about the instance, including public & private IP addresses. You may wish to note these separately.
Install Information Internet Services (IIS)
As we installed only the base AMI, we need to install a web-server. The Omnis Tech note “Setting Up The Omnis App Server” TNJS0003 covers the techniques used for installing IIS, Tomcat or Apache. For this tech note we have installed IIS.
Allowing Access to Port 80
Once you have installed the web server, it is necessary to alter the Security Group settings to allow access to Port 80.
- To do this, from the AWS Management Console, with your Instance selected, select launch-wizard-xx (where xx is a 1 or 2 digit number).
- Select the Inbound tab. This lists all the rules that allow access to the cloud server. Currently, there is only 1: The RDP (Remote Desktop Protocol) that was created automatically using the details in the 'Configure Security Group' section when we generated the server.
- Select Edit, then Add Rule. A line is added to the Rules automatically, defaulting to Custom TCP Rule. Change this in the droplist to HTTP. Leave the Source at Anywhere and the default IP mask to 0.0.0.0/0, and press Save.
- This will allow any machine, anywhere in the world to access the default website. You may wish to restrict access to certain IP addresses; if so, change the value to your required IP address range.
- You should now be able to go to a web browser and enter the IP address of your cloud server. If all is well, you should get a screen like the following (if using IIS).
Please note you may need to install the Microsoft Visual Studio Redistributables for 2012 before you are able to run Omnis Studio on your cloud server.
AWS Getting Started
AWS Instance Types
AWS Monthly Calculator
Setting Up The Omnis App Server Tech Note