Wiki source code of Deploying on Amazon EC2

Last modified by Ray Kiddy on 2021/05/08 20:56

Hide last authors
rgauss 66.1 1 == Introduction ==
Paul Hoadley 22.1 2
Pascal Robert 70.1 3 [[Amazon Elastic Compute Cloud>>url:https://aws.amazon.com/ec2/||shape="rect"]] (Amazon EC2) is part of [[Amazon Web Services>>url:https://aws.amazon.com/||shape="rect"]]. It provides "resizable compute capacity in the cloud"~-~--in other words, it allows you to run what are essentially virtual private servers of various sizes and capabilities. It is relatively straightforward to set up a WebObjects application server on an EC2 instance. There are several flavours of Linux available as base images to customize.
Paul Hoadley 22.1 4
Ray Kiddy 72.1 5 First, keep in mind, though, that Amazon EC2 instances are just giving you instances of some different operating systems. For example, as of April 2021, one sees:
rgauss 66.1 6
Ray Kiddy 72.1 7 * (((
8 Amazon Linux 2
9 )))
10 * (((
11 macOS (a few versions)]
12 )))
13 * (((
14 Red Hat Enterprise Linux 8
15 )))
16 * (((
17 Ubuntu Server
18 )))
19 * (((
20 Microsoft Windows Server (many versions and configurations)
21 )))
22 * (((
23 Debian
24 )))
rgauss 66.1 25
Ray Kiddy 72.1 26 The installation instructions for a WebObjects deployment are exactly what those for your chosen operating system. If you have picked an operating system and the deployment instructions are old or incomplete, that should tell you something. There may be dragons.
rgauss 66.1 27
Ray Kiddy 73.1 28 == Scripting ==
29
30 AWS is a great platform for scripted control of your EC2 instances. See [[https:~~/~~/aws.amazon.com/tools/>>url:https://aws.amazon.com/tools/||shape="rect"]] for information on command-line tools and SDKs for other languages, such as java, python, C++, and all the others needed for buzzword-compliance. Here is an example CLI script.
31
32
Ray Kiddy 75.1 33 \\\\[[https:~~/~~/stedolan.github.io/jq/>>url:https://stedolan.github.io/jq/||shape="rect"]]
34 \\\\\\\\\\\\\\\\\\\\
Ray Kiddy 73.1 35
Ray Kiddy 74.1 36 {{{     #!/bin/bash     # Note that these scripts rely on having 'StrictHostKeyChecking accept-new' in the ~/.ssh/config file.     #     # For jq, a sort of sed for json data, see      echo ""     id=`aws ec2 describe-instances | jq --raw-output '.Reservations[0].Instances[0].InstanceId'`     status=`aws ec2 describe-instances --instance-ids $id | jq --raw-output '.Reservations[0].Instances[0].State.Name'`     if [ $status = "running" ]; then         ip=`aws ec2 describe-instances --instance-ids $id | jq --raw-output '.Reservations[0].Instances[0].PublicIpAddress'`         echo "instance-id: $id status: $status 'ubuntu@$ip'"     else         echo "instance-id: $id status: $status"     fi     echo ""     exit 0}}}
Ray Kiddy 73.1 37
Ray Kiddy 72.1 38 == Amazon Linux 2 ==
rgauss 66.1 39
Ray Kiddy 72.1 40 Instructions for Amazon Linux 2 are TBD.
Pascal Robert 67.1 41
Ray Kiddy 72.1 42 \\
rgauss 66.1 43
Ray Kiddy 72.1 44 \\